added a generic min heap with a custom comparator

This commit is contained in:
Semere M. Mebrahtom 2026-04-01 23:19:17 +02:00
parent 6772407a3c
commit b1b32525a5
Signed by: semere
GPG key ID: 7FC937214DF30488
4 changed files with 119 additions and 14 deletions

View file

@ -129,6 +129,7 @@ void *monitor(void *param)
{
pthread_mutex_lock(&state->coders[i].info_mutex);
last = state->coders[i].last_compile;
compiles_done = state->coders[i].compiles_done;
pthread_mutex_unlock(&state->coders[i].info_mutex);
if (now() - last >= state->args.time_to_burnout)
{
@ -139,9 +140,6 @@ void *monitor(void *param)
return (NULL);
}
}
pthread_mutex_lock(&state->coders[i - 1].info_mutex);
compiles_done = state->coders[i - 1].compiles_done;
pthread_mutex_unlock(&state->coders[i - 1].info_mutex);
}
return (NULL);
}