◆ p99_threads_main()

int p99_threads_main ( int  ,
char *  [] 

A replacement name for the users main function, experimental.

compile with -DP99_INTERCEPT_MAIN to enable this feature

If compiled with the above macro definition, the users main function is silently renamed to p99_threads_main and a stub main is provided. That stub function will not do much more than creating a separate thread running p99_threads_main as the user would expect it, and then exit the thread of that stub main function.

The purpose is to ensure that all threads are C11 threads, and not only POSIX threads.

The mechanism to launch this is fragile, avoid it if possible.