mirror of git://gcc.gnu.org/git/gcc.git
Fixed deallocation of a mutex in thr-single.c (patch from Chris Ball <cball@fmco.com>).
From-SVN: r29701
This commit is contained in:
parent
ab31268c62
commit
224a6bca72
|
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Sep 23 07:19:12 1999 Chris Ball <cball@fmco.com>
|
||||||
|
|
||||||
|
* thr-posix.c (__objc_mutex_deallocate): made deallocate work.
|
||||||
|
|
||||||
Tue Sep 21 07:47:10 1999 Jeffrey A Law (law@cygnus.com)
|
Tue Sep 21 07:47:10 1999 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* Makefile.in (gc.o, gc_gc.o): Do not pass -fgnu-runtime to
|
* Makefile.in (gc.o, gc_gc.o): Do not pass -fgnu-runtime to
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,20 @@ __objc_mutex_allocate(objc_mutex_t mutex)
|
||||||
int
|
int
|
||||||
__objc_mutex_deallocate(objc_mutex_t mutex)
|
__objc_mutex_deallocate(objc_mutex_t mutex)
|
||||||
{
|
{
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Posix Threads specifically require that the thread be unlocked for
|
||||||
|
* pthread_mutex_destroy to work.
|
||||||
|
*/
|
||||||
|
|
||||||
|
while ( count )
|
||||||
|
{
|
||||||
|
if (( count = pthread_mutex_unlock((pthread_mutex_t *)mutex->backend))
|
||||||
|
< 0 )
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
|
if (pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue