Added parallelQueueWait
This commit is contained in:
parent
8c8fb185cd
commit
edde8442f5
2 changed files with 16 additions and 0 deletions
|
@ -292,6 +292,14 @@ void parallelQueueInterrupt(ParallelQueue* queue)
|
|||
}
|
||||
}
|
||||
|
||||
void parallelQueueWait(ParallelQueue* queue)
|
||||
{
|
||||
while (queue->jobs_count > 0)
|
||||
{
|
||||
timeSleepMs(100);
|
||||
}
|
||||
}
|
||||
|
||||
int parallelQueueAddJob(ParallelQueue* queue, FuncParallelJob func_process, void* data)
|
||||
{
|
||||
if (queue->stopping)
|
||||
|
|
|
@ -75,6 +75,14 @@ void parallelQueueDelete(ParallelQueue* queue);
|
|||
*/
|
||||
void parallelQueueInterrupt(ParallelQueue* queue);
|
||||
|
||||
/**
|
||||
* Wait for all jobs to finish.
|
||||
*
|
||||
* This function will return as soon as there is no pending jobs. It is recommended to stop feeding the queue, or this
|
||||
* function may never return.
|
||||
*/
|
||||
void parallelQueueWait(ParallelQueue* queue);
|
||||
|
||||
/**
|
||||
* Add a job to the queue.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue