diff options
author | Thomas Schwinge <thomas@schwinge.name> | 2011-11-05 23:44:32 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@schwinge.name> | 2011-11-05 23:44:32 +0100 |
commit | 21608c7e5aabb217977fd2db4657f28eae848d51 (patch) | |
tree | e81e81f5b9cb2fa0a9d8a4f994ea22b8ece1b621 /open_issues/libpthread_pthread_key_create_reuse | |
parent | 5b87d3c907048e24489a59a4a99f5c55cd90e9cc (diff) | |
download | web-21608c7e5aabb217977fd2db4657f28eae848d51.tar.gz web-21608c7e5aabb217977fd2db4657f28eae848d51.tar.bz2 web-21608c7e5aabb217977fd2db4657f28eae848d51.zip |
hurd/libpthread.git ea6390b2f20a03b7d504bc68a1c95e645d271149
Diffstat (limited to 'open_issues/libpthread_pthread_key_create_reuse')
-rw-r--r-- | open_issues/libpthread_pthread_key_create_reuse/pthread_key_create_reuse.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/open_issues/libpthread_pthread_key_create_reuse/pthread_key_create_reuse.c b/open_issues/libpthread_pthread_key_create_reuse/pthread_key_create_reuse.c deleted file mode 100644 index f7f5874e..00000000 --- a/open_issues/libpthread_pthread_key_create_reuse/pthread_key_create_reuse.c +++ /dev/null @@ -1,48 +0,0 @@ -#include <pthread.h> -#include <stdio.h> -#include <assert.h> - -#define DEBUG - -void del(void *x __attribute__((unused))) -{ -} - -void work(int val) -{ - pthread_key_t key1; - pthread_key_t key2; - -#ifdef DEBUG - printf("work/%d: start\n", val); -#endif - assert(pthread_key_create(&key1, &del) == 0); - assert(pthread_key_create(&key2, &del) == 0); -#ifdef DEBUG - printf("work/%d: pre-setspecific: %p,%p\n", val, pthread_getspecific(key1), pthread_getspecific(key2)); -#else - assert(pthread_getspecific(key1) == NULL); - assert(pthread_getspecific(key2) == NULL); -#endif - assert(pthread_setspecific(key1, (void *)(0x100 + val)) == 0); - assert(pthread_setspecific(key2, (void *)(0x200 + val)) == 0); -#ifdef DEBUG - printf("work/%d: post-setspecific: %p,%p\n", val, pthread_getspecific(key1), pthread_getspecific(key2)); -#else - assert(pthread_getspecific(key1) == (void *)(0x100 + val)); - assert(pthread_getspecific(key2) == (void *)(0x200 + val)); -#endif - assert(pthread_key_delete(key1) == 0); - assert(pthread_key_delete(key2) == 0); -} - -int main() -{ - int i; - - for (i = 0; i < 8; ++i) { - work(i + 1); - } - - return 0; -} |