mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-20 16:01:10 +08:00
* thread.cc (pthread_cond::Broadcast): Don't print error messages on invalid
mutexs - user programs are allowed to call pthread_cond_broadcast like that. (__pthread_cond_timedwait): Initialise themutex properly. (__pthread_cond_wait): Initialise themutex properly.
This commit is contained in:
parent
5a2f66ab43
commit
5691881058
@ -1,3 +1,11 @@
|
||||
Thu Jun 7 15:54:32 2001 Robert Collins <rbtcollins@hotmail.com>
|
||||
|
||||
* thread.cc (pthread_cond::Broadcast): Don't print error messages on
|
||||
invalid mutexs - user programs are allowed to call
|
||||
pthread_cond_broadcast like that.
|
||||
(__pthread_cond_timedwait): Initialise themutex properly.
|
||||
(__pthread_cond_wait): Initialise themutex properly.
|
||||
|
||||
Tue Jun 5 19:56:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_console.cc (fhandler_console::dup): Allocate space for
|
||||
|
@ -424,7 +424,10 @@ pthread_cond::BroadCast ()
|
||||
{
|
||||
if (pthread_mutex_unlock (&cond_access))
|
||||
system_printf ("Failed to unlock condition variable access mutex, this %0p\n", this);
|
||||
system_printf ("Broadcast called with invalid mutex\n");
|
||||
/* This isn't and API error - users are allowed to call this when no threads
|
||||
are waiting
|
||||
system_printf ("Broadcast called with invalid mutex\n");
|
||||
*/
|
||||
return;
|
||||
}
|
||||
while (count--)
|
||||
@ -1639,6 +1642,8 @@ __pthread_cond_timedwait (pthread_cond_t * cond, pthread_mutex_t * mutex,
|
||||
if ((((pshared_mutex *)(mutex))->flags & SYS_BASE == SYS_BASE))
|
||||
// a pshared mutex
|
||||
themutex = __pthread_mutex_getpshared (mutex);
|
||||
else
|
||||
themutex = mutex;
|
||||
|
||||
if (!verifyable_object_isvalid (*themutex, PTHREAD_MUTEX_MAGIC))
|
||||
return EINVAL;
|
||||
@ -1685,6 +1690,8 @@ __pthread_cond_wait (pthread_cond_t * cond, pthread_mutex_t * mutex)
|
||||
if ((((pshared_mutex *)(mutex))->flags & SYS_BASE == SYS_BASE))
|
||||
// a pshared mutex
|
||||
themutex = __pthread_mutex_getpshared (mutex);
|
||||
else
|
||||
themutex = mutex;
|
||||
if (!verifyable_object_isvalid (*themutex, PTHREAD_MUTEX_MAGIC))
|
||||
return EINVAL;
|
||||
if (!verifyable_object_isvalid (*cond, PTHREAD_COND_MAGIC))
|
||||
|
Loading…
x
Reference in New Issue
Block a user