diff options
author | Christopher Faylor <me@cgf.cx> | 2005-03-06 20:21:30 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-03-06 20:21:30 +0000 |
commit | 3f02a8d0f4ca99d7e82fb678db8d50819ce4156e (patch) | |
tree | 4a286194ec404b446526d9c27542eea27ac01aab /winsup/cygwin/sync.h | |
parent | a50b6b2dcd76cfb494617c37f93ebed175d60560 (diff) | |
download | cygnal-3f02a8d0f4ca99d7e82fb678db8d50819ce4156e.tar.gz cygnal-3f02a8d0f4ca99d7e82fb678db8d50819ce4156e.tar.bz2 cygnal-3f02a8d0f4ca99d7e82fb678db8d50819ce4156e.zip |
* sync.h (sync::init_lock): Declare new static member.
(sync::init()): Declare new static function.
* sync.cc (sync::init): Define.
(sync::init): Lock attempt to initialize a muto to stop multiple threads from
colliding.
* dcrt0.cc (dll_crt0_0): Initialize muto environment.
Diffstat (limited to 'winsup/cygwin/sync.h')
-rw-r--r-- | winsup/cygwin/sync.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h index 7e8b60c10..90e70a243 100644 --- a/winsup/cygwin/sync.h +++ b/winsup/cygwin/sync.h @@ -17,6 +17,7 @@ details. */ class muto { static DWORD exiting_thread; + static CRITICAL_SECTION init_lock; LONG sync; /* Used to serialize access to this class. */ LONG waiters; /* Number of threads waiting for lock. */ HANDLE bruteforce; /* event handle used to control waiting for lock. */ @@ -39,6 +40,7 @@ public: void upforgrabs () {tls = this;} // just set to an invalid address void grab () __attribute__ ((regparm (1))); static void set_exiting_thread () {exiting_thread = GetCurrentThreadId ();} + static void init (); }; extern muto muto_start; |