cond_init(3scl)cond_init(3scl)NAMEcond_init - Initializes a condition variable.
LIBRARY
SCL Threads Library (libthread.so)
SYNOPSIS
#include <synch.h>
int cond_init(
cond_t *condp,
int type,
void *arg );
PARAMETERS
Address of the condition variable to be initialized. Integer value
indicating the type of condition variable required. Possible values
are: for synchronization between threads within a single process
(process-wide scope) for synchronization between threads in different
processes (system-wide scope). Not supported in this release of the
Solaris Compatibility Libraries. Unused. Typically NULL.
DESCRIPTION
This routine initializes a condition variable. A condition variable is
usually used with a mutex and a predicate to facilitate synchronization
between threads.
SCL IMPLEMENTATION NOTEScond_init(3scl) is implemented by calling pthread_cond_init(3).
In this implementation of the Solaris Compatibility Libraries for Tru64
UNIX, system-wide (USYNC_PROCESS) condition variables are not sup‐
ported. When an attempt to initialize a condition variable to type
USYNC_PROCESS is made, the action taken by this routine is controlled
by the environment variable STL_USYNC_PROCESS_ACTION, which can be set
to: log an error message and abort the process (this is the default
action) returns EINVAL error-status initializes condition variable as
type USYNC_THREAD
RETURN VALUES
If an error condition occurs, this routine returns an integer value
indicating the type of error.
Additional error return information may be written to the SCL error
log. Refer to scl_error_log(4scl) for details.
Possible return values are as follows:
Successful completion.
Invalid "type" parameter. Or:
"type" equals USYNC_PROCESS, which is not supported and the
STL_USYNC_PROCESS_ACTION variable is set to ERROR. A message to this
effect is written to the SCL errorlog. Or:
EINVAL from pthread_cond_init(3). An internal implementation
error occurred. Refer to the SCL errorlog for additional information.
Note: EFAULT is not returned if condp is an illegal address. An illegal
address generates a SIGSEGV signal, which by default will abort the
process and generate a core dump.
ERRORS
None.
RELATED INFORMATION
Functions: cond_broadcast(3scl), cond_destroy(3scl), cond_signal(3scl),
cond_timedwait(3scl), cond_wait(3scl), pthread_cond_init(3),
scl_intro(3scl), scl_thread_intro(3scl)
Files: scl_error_log(4scl)
Manuals: Solaris Compatibility Libraries User's Guide
cond_init(3scl)