[qwaq] Correct some queue test logic

This fixes the wedge during initial setup and drawing, but the program
deadlocks when processing input and there's an event.
This commit is contained in:
Bill Currie 2020-03-21 12:02:35 +09:00
parent abedb465af
commit fb17f8093d

View file

@ -242,7 +242,7 @@ acquire_string (qwaq_resources_t *res)
int string_id = -1;
pthread_mutex_lock (&res->string_id_cond.mut);
while (!RB_DATA_AVAILABLE (res->string_ids)) {
while (RB_DATA_AVAILABLE (res->string_ids) < 1) {
pthread_cond_wait (&res->string_id_cond.rcond,
&res->string_id_cond.mut);
}
@ -256,7 +256,7 @@ static void
release_string (qwaq_resources_t *res, int string_id)
{
pthread_mutex_lock (&res->string_id_cond.mut);
while (RB_SPACE_AVAILABLE (res->string_ids)) {
while (RB_SPACE_AVAILABLE (res->string_ids) < 1) {
pthread_cond_wait (&res->string_id_cond.wcond,
&res->string_id_cond.mut);
}