Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-05-04 05:20:05 +0400
committerChristopher Faylor <me@cgf.cx>2005-05-04 05:20:05 +0400
commit530d0e0191328b1f663f05d54dd2c44a1d911b0e (patch)
tree34e96b48713e7fc07150f4f2bfe4be199bc483d8 /winsup
parent782e53ca6948c582cf70469f80bfae28ef889e6c (diff)
* shared.cc (user_shared_initialize): Rework locking so that nothing is checked
until cb is non-zero.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/shared.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index dcb26a9af..b1b4dc41a 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -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