CEEOPCT

C library interface: pthread_cond_timedwait()

This function is same as the CEEOPCW function, except that an error is returned if the absolute time specified by tv_sec and tv_nsec passes before the condition specified by cond is signaled. The associated mutex is reacquired before return.

Syntax

void CEEOPCT (cond, mutex, tv_sec, tv_nsec, [fc])
CEE_TOKEN    *cond;
CEE_MUTEX    *mutex;
INT4         *tv_sec;
INT4         *tv_nsec;
FEED_BACK    *fc;
CEEOPCT
Call this CWI interface as follows:
L     R15,CEECAALEOV-CEECAA(,R12)     CAA address is in R12
L     R15,0232(,R15)
BALR  R14,R15
cond (input)
The condition variable to wait on.
mutex (input)
The associated locked mutex.
tv_sec (input)
Specifies time in seconds from midnight, January 1, 1970 UTC when CEEOPCT should cease wait for a condition signal. The value specified must be greater than zero (0) and less than 2,147,483,648 seconds. If a positive value is specified and is less than or equal to current calendar time expressed seconds from midnight, January 1, 1970 UTC, CEEOPCT returns immediately, thus indicating that the time to wait has elapsed.
tv_nsec (input)
Specifies time in nanoseconds to be added to tv_sec to determine when CEEOPCT should cease wait for a condition signal. The value specified must be greater than or equal to zero (0) and less than 1,000,000,000 (1,000 million).
fc (output/optional)
The feedback code returned by the service. It indicates the degree of success in waiting for the condition variable.

The following message identifiers and associated severities can be returned by the service in the feedback code fc.

Condition  
CEE000 Severity 0
Msg_No 0000
Message The service completed successfully.
CEE4S9 Severity 3
Msg_No 5001
Message The service is unavailable unless POSIX(ON) runtime option specified and z/OS UNIX System Services are started.
CEE5I5 Severity 3
Msg_No 5701
Message The mutex specified by mutex is not initialized.
CEE5I8 Severity 4
Msg_No 5704
Message Address exception while referencing storage allocated by mutex initialization for pthread_mutex_t object specified by mutex.
CEE5IA Severity 3
Msg_No 5706
Message The mutex specified by mutex is not owned by the calling thread.
CEE5IO Severity 4
Msg_No 5720
Message Mutex specified by mutex not reacquired after condition wait terminated because thread was forced to terminate.
CEE5IU Severity 3
Msg_No 5726
Message The condition variable specified by cond is not initialized.
CEE5J0 Severity 4
Msg_No 5728
Message Address exception while referencing storage allocated by condition initialization for cond_t object specified by cond.
CEE5J1 Severity 3
Msg_No 5729
Message The mutex specified by mutex is a recursive mutex.
CEE5J2 Severity 3
Msg_No 5730
Message A mutex other than the mutex specified by mutex is already associated with the condition specified by cond.
CEE5J3 Severity 3
Msg_No 5731
Message Unexpected return code from z/OS UNIX condition setup, BPX1CSE, callable service.
CEE5J5 Severity 3
Msg_No 5731
Message The value specified by tv_sec is not valid.
CEE5J6 Severity 3
Msg_No 5734
Message The value specified by tv_nsec is not valid.
CEE5J7 Severity 3
Msg_No 5735
Message System time of day clock is not valid.
CEE5J8 Severity 1
Msg_No 5736
Message The time specified by tv_sec and tv_nsec to wait for condition signal has passed.
CEE5J9 Severity 3
Msg_No 5737
Message Unexpected return code from condition timedwait, BPX1CTW or BPX1STE, callable service.
CEE5L3 Severity 3
Msg_No 5795
Message The callable service, BPX1SMC, failed during shared condition variable processing. The system return code was return_code. The reason code was return_code X'00'.
Note: The Language Environment date/time services can be used to obtain the needed number of seconds for the abstime. The user needs to obtain the number of seconds from 00:00:00 14 Oct 1585 until 00:00:00 1 Jan 1970. When calculated, that time can be saved and used to determine the absolute time.