Apply patch to switch completely to using pthreads

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29367 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2010-01-23 17:00:13 +00:00
parent 1c3636512f
commit 3ae126279b
8 changed files with 174 additions and 197 deletions

View file

@ -32,6 +32,8 @@
#import <callback.h>
#import "callframe.h"
#include <pthread.h>
#import "GSInvocation.h"
#ifndef INLINE
@ -136,7 +138,7 @@ static GSIMapTable_t ff_callback_map;
/* Lock that protects the ff_callback_map */
static objc_mutex_t ff_callback_map_lock = NULL;
static pthread_mutex_t ff_callback_map_lock = PTHREAD_MUTEX_INITIALIZER;
/* Static pre-computed return type info */
@ -477,7 +479,7 @@ static IMP gs_objc_msg_forward (SEL sel)
GSIMapNode node;
// Lock
objc_mutex_lock (ff_callback_map_lock);
pthread_mutex_lock (&ff_callback_map_lock);
node = GSIMapNodeForKey (&ff_callback_map,
(GSIMapKey) ((void *) &returnInfo));
@ -503,7 +505,7 @@ static IMP gs_objc_msg_forward (SEL sel)
(GSIMapVal) forwarding_callback);
}
// Unlock
objc_mutex_unlock (ff_callback_map_lock);
pthread_mutex_unlock (&ff_callback_map_lock);
}
return forwarding_callback;
}
@ -512,8 +514,6 @@ static IMP gs_objc_msg_forward (SEL sel)
{
int index;
ff_callback_map_lock = objc_mutex_allocate ();
for (index = 0; index < STATIC_CALLBACK_LIST_SIZE; ++index)
{
returnTypeInfo[index].type = index;