From 47ff0994591f9f91594c752b5a5b041a86a50e04 Mon Sep 17 00:00:00 2001 From: mob Date: Sun, 5 Aug 2007 19:43:17 +0300 Subject: [PATCH] Add comment warning about static variable usage in multi threading environments --- fileops/listdir_recursive.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fileops/listdir_recursive.c b/fileops/listdir_recursive.c index acae8ec..74405c5 100755 --- a/fileops/listdir_recursive.c +++ b/fileops/listdir_recursive.c @@ -7,6 +7,10 @@ #include #include +/* Since listdir() uses a static variable to keep track of the call depth, + it is not safe to use it in a multi threading environment. If this is the + case, then you need to pass 'dirdepth' as an argument to listdir(). + */ int listdir(const char *path) { struct dirent *pdent; -- 2.11.4.GIT