about summary refs log tree commit diff
path: root/src/thread/pthread_key_create.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-03 02:40:18 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-03 02:40:18 -0400
commit537d33d33478034b62928e5cacf397b049ac78ab (patch)
treecb84cb705253897a38c1025971990ebbd6cd7f5c /src/thread/pthread_key_create.c
parentfd80cfa00b34ec81b3049b98c66f6a45301ca6c4 (diff)
downloadmusl-537d33d33478034b62928e5cacf397b049ac78ab.tar.gz
musl-537d33d33478034b62928e5cacf397b049ac78ab.tar.xz
musl-537d33d33478034b62928e5cacf397b049ac78ab.zip
simplify pthread tsd key handling
Diffstat (limited to 'src/thread/pthread_key_create.c')
-rw-r--r--src/thread/pthread_key_create.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c
index 2316a46f..fa8a6541 100644
--- a/src/thread/pthread_key_create.c
+++ b/src/thread/pthread_key_create.c
@@ -15,7 +15,6 @@ int pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
 	unsigned j = i;
 
 	pthread_self();
-	libc.tsd_keys = keys;
 	if (!dtor) dtor = nodtor;
 	do {
 		if (!a_cas_p(keys+j, 0, dtor)) {
@@ -26,6 +25,12 @@ int pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
 	return EAGAIN;
 }
 
+int pthread_key_delete(pthread_key_t k)
+{
+	keys[k] = 0;
+	return 0;
+}
+
 void __pthread_tsd_run_dtors(pthread_t self)
 {
 	int i, j, not_finished = self->tsd_used;