NTHM_BUSY (3)
NTHM MANUAL
NTHM_BUSY (3)

NAME

nthm_busy - inquire as to whether a thread has finished running

SYNOPSIS

#include <nthm/nthm.h>

int nthm_busy ( nthm_pipe source , int *err )

DESCRIPTION

The nthm_busy function polls the given pipe source to ascertain whether a successful call to nthm_read on source would return immediately to the caller with a completed result or would block because the source thread has not finished computing one.

RETURN VALUE

If nthm_busy succeeds, then it returns non-zero for threads that are still running and zero for threads that are finished running.

If it does not succeed, then it returns zero.

The caller can disambiguate a return value of zero by the code assigned to the *err parameter.

ERRORS

Error codes are reported in the *err parameter, with any non-zero value indicating an error.

NTHM_NULPIP

The source parameter is a NULL pointer.

NTHM_INVPIP

The source parameter is not a NULL pointer but points to an invalid or corrupted pipe, or points nowhere in particular but fortunately did not cause a segfault.

SEE ALSO

nthm, nthm_open, nthm_send, nthm_select, nthm_truncate, nthm_truncate_all, nthm_truncated, nthm_enter_scope, nthm_exit_scope, nthm_kill, nthm_kill_all, nthm_killed, nthm_untether, nthm_tether, nthm_blocked, nthm_strerror, pthreads (7), nthm_sync

AUTHOR

Dennis Furey (milonga@delayinsensitive.com)

PROJECT PAGE

https://github.com/gueststar/nthm

NTHM VERSION 0.10.14
May 17, 2024
NTHM_BUSY (3)