Changeset 38d8849 in mainline for uspace/app/rcutest/rcutest.c
- Timestamp:
- 2018-07-16T15:58:51Z (6 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/rcutest/rcutest.c
rc124c985 r38d8849 41 41 #include <mem.h> 42 42 #include <errno.h> 43 #include <thread.h>44 43 #include <assert.h> 45 44 #include <async.h> … … 759 758 /*--------------------------------------------------------------------*/ 760 759 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 770 760 static bool create_threads(size_t cnt) 771 761 { 772 762 /* Sanity check. */ 773 763 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); 789 765 return true; 790 766 }
Note:
See TracChangeset
for help on using the changeset viewer.