* thread.cc (__cygwin_lock_lock): Don't bother locking when there is only one
known thread. (__cygwin_lock_unlock): Ditto for unlocking.
This commit is contained in:
parent
dce592cd8c
commit
76a3f968a5
|
@ -1,3 +1,9 @@
|
||||||
|
2004-06-27 Christopher Faylor <me@cgf.cx>
|
||||||
|
|
||||||
|
* thread.cc (__cygwin_lock_lock): Don't bother locking when there is
|
||||||
|
only one known thread.
|
||||||
|
(__cygwin_lock_unlock): Ditto for unlocking.
|
||||||
|
|
||||||
2004-06-23 Tomas Ukkonen <tomas.ukkonen@iki.fi>
|
2004-06-23 Tomas Ukkonen <tomas.ukkonen@iki.fi>
|
||||||
|
|
||||||
* fhandler_proc.cc (format_proc_cpuinfo): Test CPU vendor and print
|
* fhandler_proc.cc (format_proc_cpuinfo): Test CPU vendor and print
|
||||||
|
|
|
@ -79,7 +79,13 @@ __cygwin_lock_fini (_LOCK_T *lock)
|
||||||
extern "C" void
|
extern "C" void
|
||||||
__cygwin_lock_lock (_LOCK_T *lock)
|
__cygwin_lock_lock (_LOCK_T *lock)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock ((pthread_mutex_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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int
|
extern "C" int
|
||||||
|
@ -92,7 +98,13 @@ __cygwin_lock_trylock (_LOCK_T *lock)
|
||||||
extern "C" void
|
extern "C" void
|
||||||
__cygwin_lock_unlock (_LOCK_T *lock)
|
__cygwin_lock_unlock (_LOCK_T *lock)
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock ((pthread_mutex_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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline LPCRITICAL_SECTION
|
inline LPCRITICAL_SECTION
|
||||||
|
|
Loading…
Reference in New Issue