#include <pthread.h>
|
int
pthread_setspecific (pthread_key_t key, const void *value); |
The effect of calling pthread_setspecific with a key value not obtained from pthread_key_create or after key has been deleted with pthread_key_delete is undefined.
The pthread_setspecific function may be called from a thread-specific data destructor function, however this may result in lost storage or infinite loops.
pthread_key_t keys; void* rc; if(pthread_key_create(&keys, NULL) != 0) { printf("Error: pthread_key_create() failed\n"); return -1; } else { if(pthread_setspecific(keys, (void *)(long)(100)) != 0) { printf("Error: pthread_setspecific() failed\n"); return -1; } }
[EINVAL] | |
The key value is invalid. | |
© 2005-2007 Nokia |