OSDN Git Service

* shared.cc (init_installation_root): Change to make sure that scope of the
authorcgf <cgf>
Thu, 18 Mar 2010 19:10:11 +0000 (19:10 +0000)
committercgf <cgf>
Thu, 18 Mar 2010 19:10:11 +0000 (19:10 +0000)
lock lasts the entire function.

winsup/cygwin/ChangeLog
winsup/cygwin/shared.cc

index 141bf30..fb22507 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-18  Corinna Vinschen  <corinna@vinschen.de>
+
+       * shared.cc (init_installation_root): Change to make sure that scope of
+       the lock lasts the entire function.
+
 2010-03-15  Christopher Faylor  <me+cygwin@cgf.cx>
 
        * shared_info.h (user_info): Add dll_crt0_1 as a friend.
index 4ef8807..10d03b0 100644 (file)
@@ -67,7 +67,8 @@ static LONG installation_root_inited __attribute__((section (".cygwin_dll_common
 void inline
 init_installation_root ()
 {
-  if (!spinlock (installation_root_inited))
+  spinlock iri (installation_root_inited);
+  if (!iri)
     {
       if (!GetModuleFileNameW (cygwin_hmodule, installation_root, PATH_MAX))
        api_fatal ("Can't initialize Cygwin installation root dir.\n"