What's interesting is that setenv itself is protected by a lock so multiple parallel calls to setenv ought to work (I didn't actually check). getenv doesn't use a lock.<p><a href="https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/setenv.c;h=e2164371ade896e9b3342754724e5ca381beb64e;hb=HEAD#l55" rel="nofollow">https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/sete...</a>