Skip to content

Commit

Permalink
Merge pull request #1696 from dawgfoto/fix11112
Browse files Browse the repository at this point in the history
fix Issue 11112 - Unable to execute shell commands in different threads
  • Loading branch information
braddr committed Nov 18, 2013
2 parents 1ef2958 + 17e5cc9 commit 01be956
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions std/internal/processinit.d
Expand Up @@ -13,10 +13,10 @@ module std.internal.processinit;

version(OSX)
{
extern(C) void std_process_static_this();
extern(C) void std_process_shared_static_this();

shared static this()
{
std_process_static_this();
std_process_shared_static_this();
}
}
9 changes: 7 additions & 2 deletions std/process.d
Expand Up @@ -153,15 +153,20 @@ version (Posix)
version (OSX)
{
extern(C) char*** _NSGetEnviron() nothrow;
private const(char**)* environPtr;
extern(C) void std_process_static_this() { environPtr = _NSGetEnviron(); }
private __gshared const(char**)* environPtr;
extern(C) void std_process_shared_static_this() { environPtr = _NSGetEnviron(); }
const(char**) environ() @property @trusted nothrow { return *environPtr; }
}
else
{
// Made available by the C runtime:
extern(C) extern __gshared const char** environ;
}

unittest
{
new Thread({assert(environ !is null);}).start();
}
}


Expand Down

0 comments on commit 01be956

Please sign in to comment.