diff options
Diffstat (limited to 'misc/thread_pool.h')
-rw-r--r-- | misc/thread_pool.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/thread_pool.h b/misc/thread_pool.h index 4c15c0b5c5..14954da58f 100644 --- a/misc/thread_pool.h +++ b/misc/thread_pool.h @@ -26,4 +26,9 @@ struct mp_thread_pool *mp_thread_pool_create(void *ta_parent, int init_threads, bool mp_thread_pool_queue(struct mp_thread_pool *pool, void (*fn)(void *ctx), void *fn_ctx); +// Like mp_thread_pool_queue(), but only queue the item and succeed if a thread +// can be reserved for the item (i.e. minimal wait time instead of unbounded). +bool mp_thread_pool_run(struct mp_thread_pool *pool, void (*fn)(void *ctx), + void *fn_ctx); + #endif |