Changeset 38d8849 in mainline for uspace/app/rcubench/rcubench.c
- Timestamp:
- 2018-07-16T15:58:51Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- db51219f
- Parents:
- c124c985
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-14 16:53:46)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-16 15:58:51)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/rcubench/rcubench.c
rc124c985 r38d8849 40 40 #include <mem.h> 41 41 #include <errno.h> 42 #include <thread.h>43 42 #include <assert.h> 44 43 #include <async.h> … … 105 104 } 106 105 107 static voidthread_func(void *arg)106 static errno_t thread_func(void *arg) 108 107 { 109 108 bench_t *bench = (bench_t *)arg; … … 113 112 /* Signal another thread completed. */ 114 113 futex_up(&bench->done_threads); 114 return EOK; 115 115 } 116 116 … … 123 123 } 124 124 125 fibril_test_spawn_runners(bench->nthreads - 1); 126 125 127 /* Create and run the first nthreads - 1 threads.*/ 126 128 for (size_t k = 1; k < bench->nthreads; ++k) { 127 thread_id_t tid; 128 /* Also sets up a fibril for the thread. */ 129 errno_t ret = thread_create(thread_func, bench, "rcubench-t", &tid); 130 if (ret != EOK) { 129 fid_t f = fibril_create(thread_func, bench); 130 if (!f) { 131 131 printf("Error: Failed to create benchmark thread.\n"); 132 132 abort(); 133 133 } 134 thread_detach(tid); 134 fibril_detach(f); 135 fibril_add_ready(f); 135 136 } 136 137
Note:
See TracChangeset
for help on using the changeset viewer.