Modules | Macros | Functions
C11 thread emulation on top of POSIX threads
+ Collaboration diagram for C11 thread emulation on top of POSIX threads:




#define main   p99_threads_main


 P99_DECLARE_THREAD_LOCAL (p00_thrd *, p00_thrd_local)
 P99_MAIN_INTERCEPT (p99_threads_main)
 P99_SETJMP_INLINE (p00_thrd_create) void *p00_thrd_create(void *p00_context)
int p99_threads_main (int, char *[])
 A replacement name for the users main function, experimental. More...
 P99_WEAK (p00_foreign_cleanup) void p00_foreign_cleanup(void)
 P99_WEAK (p00_foreign_nb) atomic_size_t p00_foreign_nb
 P99_WEAK (p00_foreign_tab) p00_thrd **p00_foreign_tab
 P99_WEAK (p00_threads_main) int p00_threads_main(void *p00_arg)

Detailed Description

This is a relatively straightforward implementation of the C11 thread model on top of POSIX threads. The main difficulty this presents is that the thread entry function signature differs between the two. C11 thread returns an int whereas POSIX returns a void*.

You can find the thread management interfaces through the documentation of the type ::thrd_t.

In addition to POSIX threads this implementation needs some C11 atomic operations for initialization via call_once and status communication.