[Midnightbsd-cvs] src: thr_spec.c: Fix a bug in libpthread where libobjc is loaded first
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Mon Nov 26 11:18:13 EST 2007
Log Message:
-----------
Fix a bug in libpthread where libobjc is loaded first which causes GNUstep to fail when calling pthread_key_create.
Modified Files:
--------------
src/lib/libpthread/thread:
thr_spec.c (r1.1.1.1 -> r1.2)
-------------- next part --------------
Index: thr_spec.c
===================================================================
RCS file: /home/cvs/src/lib/libpthread/thread/thr_spec.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/thread/thr_spec.c -L lib/libpthread/thread/thr_spec.c -u -r1.1.1.1 -r1.2
--- lib/libpthread/thread/thr_spec.c
+++ lib/libpthread/thread/thr_spec.c
@@ -50,9 +50,14 @@
int
_pthread_key_create(pthread_key_t *key, void (*destructor) (void *))
{
- struct pthread *curthread = _get_curthread();
+ struct pthread *curthread;
int i;
+ if (_thr_initial == NULL)
+ _libpthread_init(NULL);
+
+ curthread = _get_curthread();
+
/* Lock the key table: */
THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
for (i = 0; i < PTHREAD_KEYS_MAX; i++) {
More information about the Midnightbsd-cvs
mailing list