Skip to content

Commit 158292b

Browse files
committed
use TLS for dispatch_tid_self()
1 parent b5d2aeb commit 158292b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shims/lock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ typedef pid_t dispatch_lock_owner;
9898
#define DLOCK_OWNER_MASK ((dispatch_lock)FUTEX_TID_MASK)
9999
#define DLOCK_WAITERS_BIT ((dispatch_lock)FUTEX_WAITERS)
100100
#define DLOCK_FAILED_TRYLOCK_BIT ((dispatch_lock)FUTEX_OWNER_DIED)
101-
#define _dispatch_tid_self() ((dispatch_lock_owner)_dispatch_thread_port())
101+
#define _dispatch_tid_self() \
102+
((dispatch_lock_owner)(_dispatch_get_tsd_base()->tid))
102103

103104
DISPATCH_ALWAYS_INLINE
104105
static inline bool

0 commit comments

Comments
 (0)