2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * Test thread specific data functionality.
15 #include <afs/param.h>
28 void destruct(void *val) {
31 void * threadFunc(void *arg) {
33 pthread_setspecific(key, arg);
34 assert(pthread_getspecific(key) == arg);
39 int main(int argc, char **argv) {
44 i = pthread_key_create(&key,destruct);
48 i = pthread_create(&tid[j], (const pthread_attr_t *) 0,
49 threadFunc, (void *) j);
53 i = pthread_join(tid[j], (void **) 0);