- Timestamp:
- Aug 10, 2022, 8:33:42 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 7f6a7c9
- Parents:
- 20be782
- Location:
- tests/concurrent/pthread
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/pthread/.expect/pthread_attr_test.txt
r20be782 r428adbc 1 Hi 1 stack size is 123456789 -
tests/concurrent/pthread/bounded_buffer.cfa
r20be782 r428adbc 4 4 #include <pthread.h> 5 5 #include <errno.h> 6 // tested pthread mutex related routines, pthread cond related routines 7 // tested pthread_create/join 8 6 9 enum { BufferSize = 50 }; 7 10 -
tests/concurrent/pthread/pthread_attr_test.cfa
r20be782 r428adbc 4 4 #include <thread.hfa> 5 5 6 void* foo(void* arg){ 7 sout | "Hi"; 6 void* foo(void* _attr){ 7 size_t size; 8 pthread_attr_t* attr = (pthread_attr_t*)_attr; 9 int status = pthread_attr_getstacksize(attr, &size); 10 if (status != 0){ 11 sout | "error return code"; 12 exit(1); 13 } 14 sout | "stack size is " | size; 8 15 return NULL; 9 16 } … … 16 23 pthread_t thr; 17 24 void* res; 18 pthread_create(&thr, &attr, foo, NULL);25 pthread_create(&thr, &attr, foo, (void*)&attr); 19 26 pthread_join(thr, &res); 20 //pthread_attr_destroy(&attr);27 pthread_attr_destroy(&attr); 21 28 return 0; 22 29 } -
tests/concurrent/pthread/pthread_cond_test.cfa
r20be782 r428adbc 1 /* test cond provide sync*/1 /* small test of pthread cond */ 2 2 3 3 #include <fstream.hfa> -
tests/concurrent/pthread/pthread_demo_create_join.cfa
r20be782 r428adbc 1 1 #include <fstream.hfa> 2 2 #include <thread.hfa> 3 /* test that threads can create successfully and join correct result */ 3 /* test pthread create/join/exit */ 4 4 5 int arr[20]; 5 6 -
tests/concurrent/pthread/pthread_key_test.cfa
r20be782 r428adbc 1 1 2 /* This test is to test that multiple threads can create one key and set their own specifics2 /* test pthread_key_create/set_specific/get_specific 3 3 get specific == set specific 4 4 dtor is invoked (no mem leak) -
tests/concurrent/pthread/pthread_once_test.cfa
r20be782 r428adbc 1 #ifndef _OPEN_THREADS 2 #define _OPEN_THREADS 3 #endif 1 // tested pthread once,create,join 2 4 3 5 4
Note: See TracChangeset
for help on using the changeset viewer.