/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: bing.wei.liu REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * Test that pthread_getspecific() * * shall return the value currently bound to the specified key on behalf of the calling thread. * Calling pthread_getspecific() with a key value not obtained from pthread_key_create() or * after key has been deleted with pthread_key_delete() is undefined. * * Steps: * 1. Create NUM_OF_KEYS pthread_key_t objects * 2. Set each key to a thread-specific value with pthread_setspecific() * 3. Call pthread_getspecific() on each key and check that the value returned is correct. * */ #include #include #include #include #include "posixtest.h" #define NUM_OF_KEYS 10 #define KEY_VALUE 0 int main() { pthread_key_t keys[NUM_OF_KEYS]; int i; void* rc; for(i = 0;i