Loading...
--- Libc/Libc-391.4.2/pthreads/pthread_tsd.c
+++ Libc/Libc-320/pthreads/pthread_tsd.c
@@ -2,6 +2,8 @@
* Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
+ *
+ * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
@@ -59,12 +61,6 @@
void (*destructor)(void *);
} _pthread_keys[_POSIX_THREAD_KEYS_MAX];
static pthread_lock_t tds_lock = LOCK_INITIALIZER;
-/*
- * Partition _pthread_keys in a lower part that dyld can use, and an upper
- * part for libSystem. The libSystem part starts at __pthread_tsd_first = 4.
- * dyld will set this value to 1.
- */
-__private_extern__ int __pthread_tsd_first = 4;
/*
* Create a new key for thread specific data
@@ -77,7 +73,7 @@
LOCK(tds_lock);
res = ENOMEM; /* No 'free' keys */
/* The first slot is reserved for pthread_self() */
- for (i = __pthread_tsd_first; i < _POSIX_THREAD_KEYS_MAX; i++)
+ for (i = 1; i < _POSIX_THREAD_KEYS_MAX; i++)
{
if (_pthread_keys[i].created == FALSE)
{
@@ -101,7 +97,7 @@
int res;
LOCK(tds_lock);
/* The first slot is reserved for pthread_self() */
- if ((key >= __pthread_tsd_first) && (key < _POSIX_THREAD_KEYS_MAX))
+ if ((key > 0) && (key < _POSIX_THREAD_KEYS_MAX))
{
if (_pthread_keys[key].created)
{
@@ -143,7 +139,7 @@
int res;
pthread_t self;
/* The first slot is reserved for pthread_self() */
- if ((key >= __pthread_tsd_first) && (key < _POSIX_THREAD_KEYS_MAX))
+ if ((key > 0) && (key < _POSIX_THREAD_KEYS_MAX))
{
if (_pthread_keys[key].created)
{
@@ -172,7 +168,7 @@
for (j = 0; j < PTHREAD_DESTRUCTOR_ITERATIONS; j++)
{
/* The first slot is reserved for pthread_self() */
- for (i = __pthread_tsd_first; i < _POSIX_THREAD_KEYS_MAX; i++)
+ for (i = 1; i < _POSIX_THREAD_KEYS_MAX; i++)
{
if (_pthread_keys[i].created && (param = self->tsd[i]))
{