![]() |
|
||||
POSIX 1.c Migration Guide |
Thread Management
Thread Creation Attributes
POSIX.1c changes to thread creation attributes are relatively minor. The following table is a comparison of the revised interfaces and their corresponding
POSIX.4a versions:
Thread Creation Attribute Function Changes POSIX.1c POSIX.4aIn LynxOS, the POSIX.1c function pthread_attr_destroy() sets the attribute object to an invalid value to prevent its subsequent use
without reinitialization.POSIX.4a does not provide a facility to create a thread in anything other than a joinable state, requiring a thread to be explicitly detached via pthread_detach(). POSIX.1c allows a thread to be created in a detached state by using pthread_attr_setdetachstate() to set the detachstate attribute to PTHREAD_CREATE_DETACHED (the default is PTHREAD_CREATE_JOINABLE).
Thread Management Functions
POSIX.1c changes to thread management are also relatively minor. The following table is a comparison of the revised interfaces and their corresponding
POSIX.4a versions:
Thread Management Function Changes POSIX.1c POSIX.4a
Thread Fork Handlers
POSIX.1c defines the pthead_atfork() function to register handler functions to be called before and after fork(), in the context of the thread that called fork(). POSIX.4a has no such facility.
Dynamic Package Initialization
In POSIX.4a the constant pthread_once_init (all lowercase letters) is defined as the initializer for a once control object used with pthread_once(),
as follows:POSIX.1c defines the constant PTHREAD_ONCE_INIT (all uppercase letters) for this purpose:
![]() LynuxWorks, Inc. 855 Branham Lane East San Jose, CA 95138 http://www.lynuxworks.com 1.800.255.5969 |
![]() |
![]() |
![]() |
![]() |