Destroy the runners cleanly when shutting down the engine.
1 unresolved thread
1 unresolved thread
Adds a new engine_step_prop_stop
which makes the runners quit if set. engine_clean
now sets the prop, releases the runners, and pthread_join
s them.
Fixes #559 (closed).
Edited by Peter W. Draper
Merge request reports
Activity
6032 6032 */ 6033 6033 void engine_clean(struct engine *e) { 6034 6035 for (int i = 0; i < e->nr_threads; ++i) { 6034 /* Start by telling the runners to stop. */ 6035 e->step_props = engine_step_prop_done; 6036 swift_barrier_wait(&e->run_barrier); 6037 6038 /* Wait for each runner to come home. */ 6039 for (int k = 0; k < e->nr_threads; k++) { 6040 if (pthread_join(e->runners[k].thread, /*retval=*/ NULL) != 0) 6041 error("Failed to join runner %i.", k); 6036 6042 #ifdef WITH_VECTORIZATION 6037 cache_clean(&e->runners[i].ci_cache); 6038 cache_clean(&e->runners[i].cj_cache); 6043 cache_clean(&e->runners[k].ci_cache); mentioned in commit 535917ea
Please register or sign in to reply