summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-12-22 15:36:36 +0100
committerAraq <rumpf_a@web.de>2011-12-22 15:36:36 +0100
commitcc490b35b0b20c9a039fa13ca00a3bdb27473f95 (patch)
tree46954eeb738ef4179d3c0aea88650f5f325a6fe1 /lib/pure
parentf1f458137bf26cfea595eb373388a5f8b71ce4b4 (diff)
downloadNim-cc490b35b0b20c9a039fa13ca00a3bdb27473f95.tar.gz
bugfix: environment var caching is now thread safe
Diffstat (limited to 'lib/pure')
-rwxr-xr-xlib/pure/os.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index f22a53dd8..32a248f15 100755
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -554,7 +554,7 @@ proc cmpPaths*(pathA, pathB: string): int {.
 proc isAbsolute*(path: string): bool {.rtl, noSideEffect, extern: "nos$1".} =
   ## Checks whether a given `path` is absolute.
   ##
-  ## on Windows, network paths are considered absolute too.
+  ## On Windows, network paths are considered absolute too.
   when doslike:
     var len = len(path)
     result = (len > 1 and path[0] in {'/', '\\'}) or
@@ -694,8 +694,8 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1".} =
 # iterator depends on ``environment``.
 
 var
-  envComputed: bool = false
-  environment: seq[string] = @[]
+  envComputed {.threadvar.}: bool = false
+  environment {.threadvar.}: seq[string] = @[]
 
 when defined(windows):
   # because we support Windows GUI applications, things get really