Open System Services Programmer's Guide

/***************************************************/
/* wait for the threads to complete - */
/* this is where control is passed to the threads */
/* to the threads */
/***************************************************/
for (i = 0; i < nmbr_created_threads; ++i)
{
pthread_join(thread_handle[i], NULL);
}
} /* main() */
Threads Portability
The PUT Model library follows the POSIX Threads Standard document. Using thread functions
whose names end with _np (non-portable) decreases the portability of a program, because these
functions are extensions to the Standard document. Using the jacket routines provided by HP also
reduces portability of a threaded application; see “Jacket Routines (Nonblocking Versions of
SERVERCLASS_ and TMF System Calls)” (page 418) for more information about the jacket routines.
Thread Safety
The lists in this section apply to systems running J06.10 or later J-series RVUs or H06.21 or later
H-series RVUs only:
Functions listed in the Open System Services System Calls Reference Manual or in the Open
System Services Library Calls Reference Manual are safe for use in threaded programs unless
they are listed in “Functions That Are Not Thread Safe” (page 406).
Functions that contain a cancellation point are listed in “Cancellation Points” (page 407).
Functions that allow a cancellation point to occur are listed in “Potential Cancellation Points
(page 407).
Functions That Are Not Thread Safe
These functions are not safe for use in threaded applications:
mrand48()ftw()asctime()
nl_langinfo()ftw64()catgets()
nlist()gamma()chvol()
nftw()gcvt()crypt()
nftw64()get_assign_msg()ctime()
putc_unlocked()get_assign_msg_by_name()dbm_clearerr()
putchar_unlocked()get_param_by_name()dbm_close()
re_comp()get_param_msg()dbm_delete()
re_exec()get_startup_msg()dbm_error()
readdir()getc_unlocked()dbm_fetch()
readdir64()getchar_unlocked()dbm_firstkey()
regcmp()getdate()dbm_nextkey()
regex()getenv()dbm_open()
setkey()getopt()dbm_store()
strerror()gfileno()dlerror()
strtok()gmtime()drand48()
system_guardian()hcreate()ecvt()
tmpfile_guardian()hdestroy()encrypt()
tmpfile64_guardian()hsearch()fcvt()
tmpnam_guardian()inet_ntoa()fopen_guardian()
ttyname()l64a()fopen_std_file()
406 Using the POSIX User Thread (PUT) Model Library