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


Ignore:
Timestamp:
2018-07-16T15:58:51Z (6 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/rcutest/rcutest.c

    rc124c985 r38d8849  
    4141#include <mem.h>
    4242#include <errno.h>
    43 #include <thread.h>
    4443#include <assert.h>
    4544#include <async.h>
     
    759758/*--------------------------------------------------------------------*/
    760759
    761 static FIBRIL_MUTEX_INITIALIZE(blocking_mtx);
    762 
    763 static void dummy_fibril(void *arg)
    764 {
    765         /* Block on an already locked mutex - enters the fibril manager. */
    766         fibril_mutex_lock(&blocking_mtx);
    767         assert(false);
    768 }
    769 
    770760static bool create_threads(size_t cnt)
    771761{
    772762        /* Sanity check. */
    773763        assert(cnt < 1024);
    774 
    775         /* Keep this mutex locked so that dummy fibrils never exit. */
    776         bool success = fibril_mutex_trylock(&blocking_mtx);
    777         assert(success);
    778 
    779         for (size_t k = 0; k < cnt; ++k) {
    780                 thread_id_t tid;
    781 
    782                 errno_t ret = thread_create(dummy_fibril, NULL, "urcu-test-worker", &tid);
    783                 if (EOK != ret) {
    784                         printf("Failed to create thread '%zu' (error: %s)\n", k + 1, str_error_name(ret));
    785                         return false;
    786                 }
    787         }
    788 
     764        fibril_test_spawn_runners(cnt);
    789765        return true;
    790766}
Note: See TracChangeset for help on using the changeset viewer.