From: Florian Krohm Date: Sun, 23 Oct 2011 14:34:52 +0000 (+0000) Subject: Remove pth_specific.c which is unused. X-Git-Tag: svn/VALGRIND_3_7_0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b70e46e29562ad82057085d479218a165d0d7ce0;p=thirdparty%2Fvalgrind.git Remove pth_specific.c which is unused. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12219 --- diff --git a/none/tests/pth_specific.c b/none/tests/pth_specific.c deleted file mode 100644 index d71a6b2d79..0000000000 --- a/none/tests/pth_specific.c +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************** - * An example source module to accompany... - * - * "Using POSIX Threads: Programming with Pthreads" - * by Brad nichols, Dick Buttlar, Jackie Farrell - * O'Reilly & Associates, Inc. - * - ******************************************************** - * specific.c - * - */ -#include -#include -#include - -#include - -#include - -#define NUM_THREADS 3 -pthread_key_t saved_time_key; - - -void free_time(void *arg ) -{ - struct timeval *timev=(struct timeval *)arg; - printf("free_time:\n"); - free(timev); -} - -void save_the_time(void) -{ - struct timeval *timev; - - timev = (struct timeval *)malloc(sizeof(struct timeval)); - - gettimeofday(timev, NULL); - - printf("save_the_time: \t\t%ld %ld\n",timev->tv_sec, timev->tv_usec); - - - pthread_setspecific(saved_time_key, (void *)timev); - -} - -void what_time_did_i_save(void) -{ - struct timeval *timev; - - timev = pthread_getspecific(saved_time_key); - - printf("what_time_did_i_save: \t%ld %ld\n",timev->tv_sec, timev->tv_usec); - -} - -void *thread_routine(void *arg) -{ - int *my_id=(int *)arg; - - printf("thread_routine %d\n", *my_id); - - save_the_time(); - - what_time_did_i_save(); - - return(NULL); -} - -extern int -main(void) -{ - int i, *id_arg; - pthread_t threads[NUM_THREADS]; - - id_arg = (int *)malloc(NUM_THREADS*sizeof(int)); - - printf("main : initializing the key\n"); - pthread_key_create(&saved_time_key, free_time); - - printf("main : spawing the threads\n"); - for (i = 0; i < NUM_THREADS; i++) { - - id_arg[i] = i; - - pthread_create(&(threads[i]), - NULL, - thread_routine, - (void *) &(id_arg[i])); - } - - - for (i = 0; i < NUM_THREADS; i++) { - pthread_join(threads[i], NULL); - printf("main : thread %d has finished. \n", i); - } - - printf("main : goodbye\n"); - - return 0; -} - - - -