#include "mercury_util_config.h"
#include "mercury_thread.h"
Go to the source code of this file.
HG_UTIL_EXPORT int hg_thread_pool_init |
( |
unsigned int |
thread_count, |
|
|
hg_thread_pool_t ** |
pool |
|
) |
| |
Initialize the thread pool.
- Parameters
-
thread_count | [IN] number of threads that will be created at initialization |
pool | [OUT] pointer to pool object |
- Returns
- Non-negative on success or negative on failure
Destroy the thread pool.
- Parameters
-
pool | [IN/OUT] pointer to pool object |
- Returns
- Non-negative on success or negative on failure
Post the work function f to the pool.
Note that the operation may be queued depending on the number of threads and number of tasks already running.
- Parameters
-
pool | [IN/OUT] pointer to pool object |
f | [IN] pointer to function |
args | [IN] pointer to data that can be passed to function f |
- Returns
- Non-negative on success or negative on failure