posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_THREADS_EXT

POSIX Threads Extensions option group. More...

Functions

int pthread_getname_np (pthread_t thread, char *name, size_t len)
 Get the name of a thread (GNU extension).
 
int pthread_setname_np (pthread_t thread, const char *name)
 Set the name of a thread (GNU extension).
 
int pthread_timedjoin_np (pthread_t thread, void **status, const struct timespec *abstime)
 Wait for a thread to terminate with an absolute timeout (GNU extension).
 
int pthread_tryjoin_np (pthread_t thread, void **status)
 Try to join a thread without blocking (GNU extension).
 

Detailed Description

POSIX Threads Extensions option group.

Function Documentation

◆ pthread_getname_np()

int pthread_getname_np ( pthread_t  thread,
char *  name,
size_t  len 
)

Get the name of a thread (GNU extension).

Parameters
threadThread to query.
nameOutput buffer for the name.
lenSize of name buffer.
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getname_np.html

◆ pthread_setname_np()

int pthread_setname_np ( pthread_t  thread,
const char *  name 
)

Set the name of a thread (GNU extension).

Parameters
threadThread to name.
nameNull-terminated name string (max 15 characters + NUL).
Returns
0 on success, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setname_np.html

◆ pthread_timedjoin_np()

int pthread_timedjoin_np ( pthread_t  thread,
void **  status,
const struct timespec abstime 
)

Wait for a thread to terminate with an absolute timeout (GNU extension).

Parameters
threadThread to wait for.
statusOutput: exit value or PTHREAD_CANCELED.
abstimeAbsolute timeout (CLOCK_REALTIME).
Returns
0 on success, ETIMEDOUT on timeout, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_timedjoin_np.html

◆ pthread_tryjoin_np()

int pthread_tryjoin_np ( pthread_t  thread,
void **  status 
)

Try to join a thread without blocking (GNU extension).

Parameters
threadThread to try to join.
statusOutput: exit value if joined, or unchanged if not yet terminated.
Returns
0 if joined, EBUSY if the thread has not yet terminated, or a positive error number on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_tryjoin_np.html