]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove pth_specific.c which is unused.
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 23 Oct 2011 14:34:52 +0000 (14:34 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 23 Oct 2011 14:34:52 +0000 (14:34 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12219

none/tests/pth_specific.c [deleted file]

diff --git a/none/tests/pth_specific.c b/none/tests/pth_specific.c
deleted file mode 100644 (file)
index d71a6b2..0000000
+++ /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 <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <sys/time.h>
-
-#include <pthread.h>
-
-#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;
-}
-
-
-
-