diff options
author | Dave Korn <dave.korn.cygwin@gmail.com> | 2009-06-04 01:45:05 +0000 |
---|---|---|
committer | Dave Korn <dave.korn.cygwin@gmail.com> | 2009-06-04 01:45:05 +0000 |
commit | b650c255ab437b80a0c7386694888ebbe294f534 (patch) | |
tree | 3661a4c6dc5d7b687ff1ba4737a738468156235b /winsup | |
parent | f95df56a61ab3ac473a1ac1ff1f78aade0a3082c (diff) | |
download | newlib-b650c255ab437b80a0c7386694888ebbe294f534.zip newlib-b650c255ab437b80a0c7386694888ebbe294f534.tar.gz newlib-b650c255ab437b80a0c7386694888ebbe294f534.tar.bz2 |
* thread.cc (__cygwin_lock_lock): Delete racy optimisation.
(__cygwin_lock_unlock): Likewise.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 18 |
2 files changed, 10 insertions, 14 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3bc85a5..073c3e4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2009-06-04 Dave Korn <dave.korn.cygwin@gmail.com> + + * thread.cc (__cygwin_lock_lock): Delete racy optimisation. + (__cygwin_lock_unlock): Likewise. + + 2009-06-03 IWAMURO Motnori <deenheart@gmail.com> * strfuncs.cc (sys_cp_mbstowcs): Fix condition. diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 8bb6870..c02310e 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -76,13 +76,8 @@ __cygwin_lock_fini (_LOCK_T *lock) extern "C" void __cygwin_lock_lock (_LOCK_T *lock) { - if (MT_INTERFACE->threadcount <= 1) - paranoid_printf ("threadcount %d. not locking", MT_INTERFACE->threadcount); - else - { - paranoid_printf ("threadcount %d. locking", MT_INTERFACE->threadcount); - pthread_mutex_lock ((pthread_mutex_t*) lock); - } + paranoid_printf ("threadcount %d. locking", MT_INTERFACE->threadcount); + pthread_mutex_lock ((pthread_mutex_t*) lock); } extern "C" int @@ -95,13 +90,8 @@ __cygwin_lock_trylock (_LOCK_T *lock) extern "C" void __cygwin_lock_unlock (_LOCK_T *lock) { - if (MT_INTERFACE->threadcount <= 1) - paranoid_printf ("threadcount %d. not unlocking", MT_INTERFACE->threadcount); - else - { - pthread_mutex_unlock ((pthread_mutex_t*) lock); - paranoid_printf ("threadcount %d. unlocked", MT_INTERFACE->threadcount); - } + pthread_mutex_unlock ((pthread_mutex_t*) lock); + paranoid_printf ("threadcount %d. unlocked", MT_INTERFACE->threadcount); } static inline verifyable_object_state |