Changeset 1f55a75 for tests/concurrent
- Timestamp:
- Mar 23, 2021, 9:19:47 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- 98d9ce9
- Parents:
- f9c3100 (diff), e825c9d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- tests/concurrent
- Files:
-
- 2 added
- 1 edited
-
.expect/clib_tls.txt (added)
-
clib.c (modified) (3 diffs)
-
clib_tls.c (added)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/clib.c
rf9c3100 r1f55a75 2 2 #include <stdlib.h> 3 3 #include <clib/cfathread.h> 4 #include <bits/defs.hfa> 4 5 5 6 extern "C" { … … 61 62 cfathread_cluster_add_worker( cl, NULL, NULL, NULL ); 62 63 cfathread_cluster_add_worker( cl, NULL, NULL, NULL ); 64 65 cfathread_attr_t attr; 66 cfathread_attr_init(&attr); 67 cfathread_attr_setcluster(&attr, cl); 68 63 69 cfathread_t u; 64 cfathread_create( &u, NULL, Unparker, NULL );70 cfathread_create( &u, &attr, Unparker, NULL ); 65 71 { 66 72 cfathread_t t[20]; 67 73 for(int i = 0; i < 20; i++) { 68 cfathread_create( &t[i], NULL, Worker, NULL );74 cfathread_create( &t[i], &attr, Worker, NULL ); 69 75 } 70 76 for(int i = 0; i < 20; i++) { … … 74 80 stop = true; 75 81 cfathread_join(u, NULL); 82 cfathread_attr_destroy(&attr); 76 83 fflush(stdout); 77 84 _exit(0);
Note:
See TracChangeset
for help on using the changeset viewer.