mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Free jobs as soon as possible
This commit is contained in:
parent
63adb54a3d
commit
d4a303e7e6
|
@ -234,8 +234,6 @@ int threadqueue_finalize(threadqueue_queue * const threadqueue) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int threadqueue_flush(threadqueue_queue * const threadqueue) {
|
int threadqueue_flush(threadqueue_queue * const threadqueue) {
|
||||||
int notdone = 1;
|
int notdone = 1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -273,12 +271,13 @@ int threadqueue_flush(threadqueue_queue * const threadqueue) {
|
||||||
}
|
}
|
||||||
} while (notdone > 0);
|
} while (notdone > 0);
|
||||||
|
|
||||||
if (0) { //technically not needed
|
#if 1
|
||||||
for (i=0; i < threadqueue->queue_count; ++i) {
|
//technically not needed, but spares memory. On the other hand, it makes debugging harder.
|
||||||
FREE_POINTER(threadqueue->queue[i]);
|
for (i=0; i < threadqueue->queue_count; ++i) {
|
||||||
}
|
FREE_POINTER(threadqueue->queue[i]);
|
||||||
threadqueue->queue_count = 0;
|
|
||||||
}
|
}
|
||||||
|
threadqueue->queue_count = 0;
|
||||||
|
#endif
|
||||||
assert(threadqueue->queue_waiting == 0);
|
assert(threadqueue->queue_waiting == 0);
|
||||||
|
|
||||||
PTHREAD_UNLOCK(&threadqueue->lock);
|
PTHREAD_UNLOCK(&threadqueue->lock);
|
||||||
|
|
Loading…
Reference in a new issue