This simplifies logic and prevents serial context being used by multiple workers at the same time.
WorkerData *data = (WorkerData*)data_untyped;
int current_worker = (int) (data - workers_data);
WorkerData *data = (WorkerData*)data_untyped;
int current_worker = (int) (data - workers_data);
- return started && current_worker < active_workers_num;
+ return started && current_worker < active_workers_num && state_is_working_or_enqueued (data->state);