11 #ifndef MERCURY_THREAD_H
12 #define MERCURY_THREAD_H
14 #include "mercury_util_config.h"
21 #define HG_THREAD_RETURN_TYPE hg_thread_ret_t WINAPI
26 typedef void *(*hg_thread_func_t)(
void *);
28 #define HG_THREAD_RETURN_TYPE hg_thread_ret_t
114 HG_UTIL_EXPORT
void *
HG_UTIL_EXPORT int hg_thread_key_delete(hg_thread_key_t key)
Delete a thread-specific data key previously returned by hg_thread_key_create().
HG_UTIL_EXPORT int hg_thread_cancel(hg_thread_t thread)
Terminate the thread.
HG_UTIL_EXPORT void hg_thread_exit(hg_thread_ret_t ret)
Ends the calling thread.
HG_UTIL_EXPORT void hg_thread_init(hg_thread_t *thread)
Initialize the thread.
HG_UTIL_EXPORT int hg_thread_join(hg_thread_t thread)
Wait for thread completion.
pthread_key_t hg_thread_key_t
HG_UTIL_EXPORT int hg_thread_create(hg_thread_t *thread, hg_thread_func_t f, void *data)
Create a new thread for the given function.
HG_UTIL_EXPORT void * hg_thread_getspecific(hg_thread_key_t key)
Get value from specified key.
HG_UTIL_EXPORT int hg_thread_key_create(hg_thread_key_t *key)
Create a thread-specific data key visible to all threads in the process.
void *(* hg_thread_func_t)(void *)
HG_UTIL_EXPORT int hg_thread_setspecific(hg_thread_key_t key, const void *value)
Set value to specified key.