Skip to content

Commit 9933e4a

Browse files
committed
Base: s/pthread_key_t/_CFThreadSpecifiKey/
Replace `pthread_key_t` with `_CFThreadSpecificKey` to prepare for the Windows threading support.
1 parent b23dc8e commit 9933e4a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ CF_PRIVATE bool __CFBinaryPlistIsArray(const uint8_t *databytes, uint64_t datale
869869

870870
// These are replacements for pthread calls on Windows
871871
CF_EXPORT int _NS_pthread_main_np();
872-
CF_EXPORT int _NS_pthread_setspecific(pthread_key_t key, const void *val);
873-
CF_EXPORT void* _NS_pthread_getspecific(pthread_key_t key);
872+
CF_EXPORT int _NS_pthread_setspecific(_CFThreadSpecificKey key, const void *val);
873+
CF_EXPORT void* _NS_pthread_getspecific(_CFThreadSpecificKey key);
874874
CF_EXPORT int _NS_pthread_key_init_np(int key, void (*destructor)(void *));
875875
CF_EXPORT void _NS_pthread_setname_np(const char *name);
876876

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ CF_PRIVATE void __CFFinalizeWindowsThreadData() {
620620

621621
#endif
622622

623-
static pthread_key_t __CFTSDIndexKey;
623+
static _CFThreadSpecificKey __CFTSDIndexKey;
624624

625625
CF_PRIVATE void __CFTSDInitialize() {
626626
static dispatch_once_t once;
@@ -1209,8 +1209,8 @@ static void _CF_sem_destroy(_CF_sema_t s) {
12091209
free(s);
12101210
}
12111211

1212-
CF_INLINE pthread_key_t _CF_thread_sem_key() {
1213-
static pthread_key_t key = 0;
1212+
CF_INLINE _CFThreadSpecificKey _CF_thread_sem_key() {
1213+
static _CFThreadSpecificKey key = 0;
12141214
static OSSpinLock lock = OS_SPINLOCK_INIT;
12151215
if (key == 0) {
12161216
OSSpinLockLock(&lock);
@@ -1223,7 +1223,7 @@ CF_INLINE pthread_key_t _CF_thread_sem_key() {
12231223
}
12241224

12251225
CF_INLINE _CF_sema_t _CF_get_thread_semaphore() {
1226-
pthread_key_t key = _CF_thread_sem_key();
1226+
_CFThreadSpecificKey key = _CF_thread_sem_key();
12271227
_CF_sema_t s = (_CF_sema_t)pthread_getspecific(key);
12281228
if (s == NULL) {
12291229
s = malloc(sizeof(struct _CF_sema_s));

0 commit comments

Comments
 (0)