Do not start processSlotTx before it is ready to run.

Implement run-to-completion for processSlotTX. This is achieved by using a new
dynamic_barrier_t which allows to specify callback after the first join has been
made.
This commit is contained in:
Bartosz Podrygajlo
2024-11-27 18:14:59 +01:00
parent ea0ea2ff8f
commit 654cffe39f
11 changed files with 64 additions and 105 deletions
+10
View File
@@ -31,6 +31,16 @@ void dynamic_barrier_init(dynamic_barrier_t* barrier)
barrier->completed_jobs = 0;
}
void dynamic_barrier_reset(dynamic_barrier_t* barrier)
{
barrier->callback = NULL;
if (barrier->callback_arg != NULL) {
free(barrier->callback_arg);
}
barrier->callback_arg = NULL;
barrier->completed_jobs = 0;
}
void dynamic_barrier_join(dynamic_barrier_t* barrier)
{
int ret = pthread_mutex_lock(&barrier->barrier_lock);