/* * 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_key_delete() * * Shall delete a thread-specific data key previously returned by pthread_key_create. The * thread-specific data values specified data values associated with 'key' need not be NULL at * the time pthread_key_delete is called. It is the responsibility of the application to free * any application storage or perform any cleanup actions for data structures related to the * deleted key or associated thread-specific data in any threads; this cleanup can be done * either before or after pthread_key_delete is called. Any attempt to use 'key' following * the call to pthread_key_delete results in undefined behavior. * * Steps: * 1. Create many keys, and specify and value to them * 2. Delete the keys with pthread_key_delete * 3. Verify that this will not result in an error * */ #include #include #include #include #include "posixtest.h" #define NUM_OF_KEYS 10 #define KEY_VALUE 100 int main() { pthread_key_t keys[NUM_OF_KEYS]; int i; for(i = 0;i