diff options
Diffstat (limited to 'storage/tokudb/ft-index/src/tests/cilktests/foo.cilk')
-rw-r--r-- | storage/tokudb/ft-index/src/tests/cilktests/foo.cilk | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/storage/tokudb/ft-index/src/tests/cilktests/foo.cilk b/storage/tokudb/ft-index/src/tests/cilktests/foo.cilk deleted file mode 100644 index dfc5540db4b..00000000000 --- a/storage/tokudb/ft-index/src/tests/cilktests/foo.cilk +++ /dev/null @@ -1,41 +0,0 @@ -#include <pthread.h> -#include <unistd.h> -#include <assert.h> -#include <stdio.h> - -pthread_t pt[2]; -pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - -extern "C" void* start (void *extra __attribute__((__unused__))) { - { int r = pthread_mutex_lock(&mutex); assert(r==0); } - printf("T%lx got lock\n", pthread_self()); - sleep(1); - printf("T%lx releasing lock\n", pthread_self()); - { int r = pthread_mutex_unlock(&mutex); assert(r==0); } - return 0; -} - -void create_pthread(void) { - for (int i=0; i<2; i++) { - int r = pthread_create(&pt[i], 0, start, NULL); - assert(r==0); - } -} - -void join_pthread (void) { - for (int i=0; i<2; i++) { - int r = pthread_join(pt[i], NULL); - assert(r==0); - } -} - -void foo (void) { -} - -int cilk_main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) { - create_pthread(); - cilk_spawn foo(); - cilk_sync; - join_pthread(); - return 0; -} |