 |
The ROme OpTimistic Simulator
3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Go to the documentation of this file.
25 #define THREAD_CALL_CONV
26 typedef void * thr_ret_t;
27 typedef pthread_t thr_id_t;
29 #define THREAD_RET_FAILURE ((void *) 1)
30 #define THREAD_RET_SUCCESS ((void *) 0)
32 #elif defined(__WINDOWS)
34 #define WIN32_LEAN_AND_MEAN
36 #undef WIN32_LEAN_AND_MEAN
38 #define THREAD_CALL_CONV WINAPI
39 typedef DWORD arch_thr_ret_t;
40 typedef HANDLE arch_thr_t;
42 #define THREAD_RET_FAILURE (1)
43 #define THREAD_RET_SUCCESS (0)
52 extern int thread_wait(thr_id_t thr, thr_ret_t *ret);
thr_ret_t THREAD_CALL_CONV(* thr_run_fnc)(void *)
The function type of a new thread entry point.
int thread_wait(thr_id_t thr, thr_ret_t *ret)
Wait for specified thread to complete execution.
int thread_affinity_set(thr_id_t thr, unsigned core)
Sets a core affinity for a thread.
unsigned thread_cores_count(void)
Computes the count of available cores on the machine.
int thread_start(thr_id_t *thr_p, thr_run_fnc t_fnc, void *t_fnc_arg)
Creates a thread.