thr_main(3scl)thr_main(3scl)NAMEthr_main - Identifies if this is the main thread.
LIBRARY
SCL Threads Library (libthread.so)
SYNOPSIS
#include <thread.h>
int thr_main( void );
PARAMETERS
None.
DESCRIPTION
This routine returns 1 if the calling thread is the main thread.
The main thread is the first thread of a process. In a C program, the
main thread is the thread which first executes main().
SCL IMPLEMENTATION NOTES
POSIX threads has no equivalent to thr_main(3scl). Thus the SCL thread
library stores information about the main thread when the thread
library initializes, and uses this information to subsequently identify
the main thread.
Note that Solaris documents that thr_main(3scl) can return -1 if the
thread library has not been linked in, or it has not initialized. This
return value is not possible from SCL.
RETURN VALUES
Possible return values are as follows: The calling thread is not the
main thread. The calling thread is the main thread.
ERRORS
None.
RELATED INFORMATION
Functions: scl_intro(3scl), scl_thread_intro(3scl)
Manuals: Solaris Compatibility Libraries User's Guide
thr_main(3scl)