Skip to content
Snippets Groups Projects
Commit 362140e4 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Fixed tests using dt_start_id().

Doesn't guarantee waking up of the Idle threads
and blocks when used in dt_start().
Caller should either activate existing threads or
use dt_start() instead.

refs #1441
parent 58e2cdf5
No related branches found
No related tags found
No related merge requests found
......@@ -670,7 +670,6 @@ int dt_start_id(dthread_t *thread)
dbg_dt("dthreads: [%p] %s: refused to recreate thread\n",
thread, __func__);
unlock_thread_rw(thread);
dt_activate(thread);
return 0;
}
......
......@@ -159,8 +159,8 @@ static inline int dt_test_resize(dt_unit_t *unit, int size)
_runnable_i = 0;
for (int i = 0; i < size; ++i) {
ret += dt_repurpose(unit->threads[i], &runnable, 0);
ret += dt_start_id(unit->threads[i]);
}
ret += dt_start(unit);
// Wait for finish
ret += dt_join(unit);
......@@ -266,7 +266,7 @@ static int dt_tests_run(int argc, char *argv[])
pthread_mutex_init(&_runnable_mx, NULL);
/* Test 1: Create unit */
dt_unit_t *unit = dt_test_create(4);
dt_unit_t *unit = dt_test_create(2);
ok(unit != 0, "dthreads: create unit (optimal size %d)", unit->size);
skip(unit == 0, DT_TEST_COUNT - 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment