From 9097327dc1c667fc51b8e05cc7c0626fac96665d Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 14 May 2001 14:17:54 +0000 Subject: Initial revision --- .../dietlibc/libpthread/pthread_key_create.c | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 mdk-stage1/dietlibc/libpthread/pthread_key_create.c (limited to 'mdk-stage1/dietlibc/libpthread/pthread_key_create.c') diff --git a/mdk-stage1/dietlibc/libpthread/pthread_key_create.c b/mdk-stage1/dietlibc/libpthread/pthread_key_create.c new file mode 100644 index 000000000..44fccea6a --- /dev/null +++ b/mdk-stage1/dietlibc/libpthread/pthread_key_create.c @@ -0,0 +1,35 @@ +#include +#include + +#include +#include "thread_internal.h" + +extern struct _pthread_fastlock __thread_keys_lock; +extern struct _thread_key __thread_keys[PTHREAD_KEYS_MAX]; +int pthread_key_create(pthread_key_t *key, void (*destructor)(const void*)) +{ + int ret=-1,i; + + __THREAD_INIT(); + + __NO_ASYNC_CANCEL_BEGIN; + __pthread_lock(&__thread_keys_lock); + + for (i=0; i