[PATCH] added locks around mutex and cond initialization
Thu Aug 15 13:00:00 GMT 2002
The actual cond and mutex initialization have a race condition when 2
threads initializes simultanous a mutex initialized with
PTHREAD_MUTEX_INITIALIZE or a cond with PTHREAD_COND_INITIALIZER.
I have added critical sections around mutex and cond creation to fix it.
2002-08-15 Thomas Pfaff <email@example.com>
* thread.cc (MTinterface::Init): Initialize critical sections.
(MTinterface::fixup_after_fork): Ditto after fork.
(pthread_cond::TimedWait): mutex unlock calls changed.
(pthread_mutex::Lock): Return 0 on success.
(__pthread_cond_init): Added critical section around cond
(__pthread_cond_broadcast): Modified check for initialization.
(__pthread_mutex_init): Added critical section around mutex
(__pthread_mutex_getprioceiling): Modified check for
* thread.h (MUTEX_AUTOINIT_AND_CHECK): New define.
(MTinterface::mutex_lock): New member.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Cygwin-patches