This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[PATCH] fix startup race in shared.cc
- From: "Usman Muzaffar" <foo at muzaffar dot org>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 3 May 2005 17:11:44 -0700
- Subject: [PATCH] fix startup race in shared.cc
- Reply-to: "Usman Muzaffar" <foo at muzaffar dot org>
Still seeing incorrect "version mismatch" messages for processes
starting simultaneously on dual-processor systems; I believe this
patch to the recent locking work in shared.cc fixes the "user shared
memory version" errors I'm seeing.
Thanks,
-Usman
2005-05-03 Usman Muzaffar <foo@muzaffar.org>
* shared.cc (user_shared_initialize): Check for mismatched user
shared memory version with result from InterlockedExchange to
avoid startup race.
Index: cygwin/shared.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/shared.cc,v
retrieving revision 1.94
diff -u -p -r1.94 shared.cc
--- cygwin/shared.cc 30 Apr 2005 17:07:05 -0000 1.94
+++ cygwin/shared.cc 3 May 2005 23:20:02 -0000
@@ -199,8 +199,8 @@ user_shared_initialize (bool reinit)
/* Initialize the queue of deleted files. */
user_shared->delqueue.init ();
}
- else if (user_shared->version != USER_VERSION_MAGIC)
- multiple_cygwin_problem ("user shared memory version", user_shared->version, USER_VERSION_MAGIC);
+ else if (sversion != USER_VERSION_MAGIC)
+ multiple_cygwin_problem ("user shared memory version", sversion, 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