OSF DCE Problem Determination Guide

Error Messages and Status Codes
pthread_cond_init
pthread_create
pthread_mutex_init
If returned by the pthread_cond_timedwait routine, the time specified by abstime
expired before the event being waited on transpired.
Action: In most situations, this is a temporary condition, and later calls to the same
routine should complete normally.
---------- EBUSY
Severity: Warning Component: Threads
Text: Resource busy
Explanation: If returned by the pthread_cond_destroy routine, an attempt was made to
delete a condition variable for a thread that was executing a pthread_cond_timewait()
routine or a pthread_cond_wait() routine.
If returned by the pthread_mutex_destroy routine, an attempt was made to delete a
mutex that is locked (has a current owner).
Action: If you still wish to delete the condition variable, wait until the
pthread_cond_timewait() or pthread_cond_wait() routines complete and try again.
A locked mutex is owned by the thread that calls it using the pthread_mutex_lock
routine. It remains locked until the same thread unlocks it. If no threads are waiting for
the mutex, it can be unlocked by using the pthread_mutex_unlock routine. It can then be
deleted.
---------- EDEADLK
Severity: Warning Component: Threads
Text: Resource deadlock avoided
Explanation: The attempted operation would have resulted in one or more threads being
permanently blocked from executing. This situation occurs when a thread must wait on a
resource that is held by another thread. This error is returned by the following routines:
pthread_cond_timedwait
pthread_cond_wait
pthread_mutex_lock
pthread_join
Action: To avoid a deadlock situation, you can use the following technique:
1. Associate a sequence number with each mutex.
2. Lock mutexes in sequence
3. Do not attempt to lock a mutex with a sequence number lower than that of a mutex
the thread already holds.
In addition, if a thread needs to lock the same mutex more than once before unlocking it,
specify a recursive mutex in your call to pthread_mutexattr_setkind_np().
124330 Tandem Computers Incorporated 2225