]> sourceware.org Git - newlib-cygwin.git/commitdiff
* shared.cc (user_shared_initialize): Rework locking so that nothing is checked
authorChristopher Faylor <me@cgf.cx>
Wed, 4 May 2005 01:20:05 +0000 (01:20 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 4 May 2005 01:20:05 +0000 (01:20 +0000)
until cb is non-zero.

winsup/cygwin/shared.cc

index dcb26a9afef3cf7aed741570640a58f020c17aed..b1b4dc41a49e530df84205a1b57f7fc3efb2a594 100644 (file)
@@ -189,23 +189,20 @@ user_shared_initialize (bool reinit)
   /* Initialize the Cygwin per-user shared, if necessary */
   if (!sversion)
     {
-      user_shared->version = USER_VERSION_MAGIC;
       debug_printf ("initializing user shared");
-      user_shared->cb =  sizeof (*user_shared);
-      if (user_shared->cb != sizeof (*user_shared))
-       system_printf ("size of user shared region changed from %u to %u",
-                      sizeof (*user_shared), user_shared->cb);
       user_shared->mountinfo.init ();  /* Initialize the mount table.  */
-      /* Initialize the queue of deleted files.  */
-      user_shared->delqueue.init ();
+      user_shared->delqueue.init (); /* Initialize the queue of deleted files.  */
+      user_shared->cb =  sizeof (*user_shared);
     }
-  else if (user_shared->version != USER_VERSION_MAGIC)
-    multiple_cygwin_problem ("user shared memory version", user_shared->version, USER_VERSION_MAGIC);
-  else if (user_shared->cb != sizeof (*user_shared))
-    multiple_cygwin_problem ("user shared memory size", user_shared->cb, sizeof (*user_shared));
   else
+    {
       while (!user_shared->cb)
        low_priority_sleep (0); // Should be hit only very very rarely
+      if (user_shared->version != sversion)
+       multiple_cygwin_problem ("user shared memory version", user_shared->version, sversion);
+      else if (user_shared->cb != sizeof (*user_shared))
+       multiple_cygwin_problem ("user shared memory size", user_shared->cb, sizeof (*user_shared));
+    }
 }
 
 void
This page took 0.032003 seconds and 5 git commands to generate.