Method
DexLimiterrun_on_pool
unstable since: 1.2
Declaration [src]
DexFuture*
dex_limiter_run_on_pool (
DexLimiter* limiter,
DexThreadPool* pool,
DexThreadFunc thread_func,
gpointer user_data,
GDestroyNotify user_data_destroy
)
Description [src]
Runs thread_func on pool while holding one permit from limiter.
The returned future resolves or rejects with the result of the submitted
thread-pool work. The permit is released automatically after the work
resolves or rejects. If the returned future is discarded after the work is
submitted to pool, the work is allowed to complete so that the permit can be released.
Workers in DexThreadPool are not scheduler threads, so thread_func must
not use dex_await().
Available since: 1.2
Parameters
pool-
Type:
DexThreadPoolA
DexThreadPool.The data is owned by the caller of the method. thread_func-
Type:
DexThreadFuncfunction to run on
poolafter a permit is acquired. user_data-
Type:
gpointerClosure data for
thread_func.The argument can be NULL.The data is owned by the caller of the method. user_data_destroy-
Type:
GDestroyNotifyDestroy notify for
user_data.
Return value
Type: DexFuture
A future representing the submitted work.
| The caller of the method takes ownership of the returned data, and is responsible for freeing it. |