add notes about the non-thread-localness of the current directory (#4082)
authorSimon Marlow <marlowsd@gmail.com>
Mon, 4 Apr 2011 07:52:00 +0000 (08:52 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 4 Apr 2011 07:52:00 +0000 (08:52 +0100)
System/Directory.hs

index d264583..6c28eef 100644 (file)
@@ -862,6 +862,11 @@ Insufficient resources are available to perform the operation.
 * 'UnsupportedOperation'
 The operating system has no notion of current directory.
 
+Note that in a concurrent program, the current directory is global
+state shared between all threads of the process.  When using
+filesystem operations from multiple threads, it is therefore highly
+recommended to use absolute rather than relative `FilePath`s.
+
 -}
 #ifdef __GLASGOW_HASKELL__
 getCurrentDirectory :: IO FilePath
@@ -902,6 +907,11 @@ current directory cannot be dynamically changed.
 The path refers to an existing non-directory object.
 @[ENOTDIR]@
 
+Note that in a concurrent program, the current directory is global
+state shared between all threads of the process.  When using
+filesystem operations from multiple threads, it is therefore highly
+recommended to use absolute rather than relative `FilePath`s.
+
 -}
 
 setCurrentDirectory :: FilePath -> IO ()