? winsup/cygwin/cygwin-cxx.h ? winsup/cygwin/mutex Index: winsup/cygwin/thread.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/thread.cc,v retrieving revision 1.215 diff -p -u -r1.215 thread.cc --- winsup/cygwin/thread.cc 20 Jan 2009 12:40:31 -0000 1.215 +++ winsup/cygwin/thread.cc 3 Jun 2009 17:38:06 -0000 @@ -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 Index: winsup/cygwin/winbase.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/winbase.h,v retrieving revision 1.14 diff -p -u -r1.14 winbase.h --- winsup/cygwin/winbase.h 12 Jul 2008 18:09:17 -0000 1.14 +++ winsup/cygwin/winbase.h 3 Jun 2009 17:38:06 -0000 @@ -38,21 +38,21 @@ ilockdecr (volatile long *m) extern __inline__ long ilockexch (volatile long *t, long v) { - register int __res; + register long __res __asm__ ("%eax") = *t; __asm__ __volatile__ ("\n\ -1: lock cmpxchgl %3,(%1)\n\ +1: lock cmpxchgl %2,%1\n\ jne 1b\n\ - ": "=a" (__res), "=q" (t): "1" (t), "q" (v), "0" (*t): "cc"); + ": "+a" (__res), "=m" (*t): "q" (v), "m" (*t) : "memory", "cc"); return __res; } extern __inline__ long ilockcmpexch (volatile long *t, long v, long c) { - register int __res; + register long __res __asm ("%eax") = c; __asm__ __volatile__ ("\n\ - lock cmpxchgl %3,(%1)\n\ - ": "=a" (__res), "=q" (t) : "1" (t), "q" (v), "0" (c): "cc"); + lock cmpxchgl %2,%1\n\ + ": "+a" (__res), "=m" (*t) : "q" (v), "m" (*t) : "memory", "cc"); return __res; }