Changeset 38d8849 in mainline for uspace/app/rcubench/rcubench.c


Ignore:
Timestamp:
2018-07-16T15:58:51Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
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)
Message:

Privatize <thread.h>.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/rcubench/rcubench.c

    rc124c985 r38d8849  
    4040#include <mem.h>
    4141#include <errno.h>
    42 #include <thread.h>
    4342#include <assert.h>
    4443#include <async.h>
     
    105104}
    106105
    107 static void thread_func(void *arg)
     106static errno_t thread_func(void *arg)
    108107{
    109108        bench_t *bench = (bench_t *)arg;
     
    113112        /* Signal another thread completed. */
    114113        futex_up(&bench->done_threads);
     114        return EOK;
    115115}
    116116
     
    123123        }
    124124
     125        fibril_test_spawn_runners(bench->nthreads - 1);
     126
    125127        /* Create and run the first nthreads - 1 threads.*/
    126128        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) {
    131131                        printf("Error: Failed to create benchmark thread.\n");
    132132                        abort();
    133133                }
    134                 thread_detach(tid);
     134                fibril_detach(f);
     135                fibril_add_ready(f);
    135136        }
    136137
Note: See TracChangeset for help on using the changeset viewer.