OSDN Git Service

rewrite pthread_key_delete to use global thread list
authorRich Felker <dalias@aerifal.cx>
Sat, 16 Feb 2019 15:13:31 +0000 (10:13 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 16 Feb 2019 15:13:31 +0000 (10:13 -0500)
commitba74a42cee90c9a4425188a021b6ad8ba80b9468
treed253866fe48ba1e237e1a0f1fa5bb0e899538e98
parente4235d70672d9751d7718ddc2b52d0b426430768
rewrite pthread_key_delete to use global thread list

with the availability of the thread list, there is no need to mark tsd
key slots dirty and clean them up only when a free slot can't be
found. instead, directly iterate threads and clear any value
associated with the key being deleted.

no synchronization is necessary for the clearing, since there is no
way the slot can be accessed without having synchronized with the
creation of a new key occupying the same slot, which is already
sequenced after and synchronized with the deletion of the old key.
src/thread/pthread_key_create.c
src/thread/pthread_key_delete.c [deleted file]