lock
PRTY=1 |
| ATTRIBUTES |
EVENTS |
FUNCTION |
CONSEQUENCES |
| free |
EVT_COND_LOCK_FREE |
pthread_cond_broadcast
pthread_cond_signal
pthread_cond_wait |
The lock become free,
any thread can get it |
| taken |
EVT_COND_LOCK_REQUIER
EVT_COND_LOCK_TAKEN |
pthread_cond_broadcast
pthread_cond_signal |
The running thread
requieres for the lock, if it doesn't get the lock, it becomes blocked
So when the lock becomes free the thread gets it, then the thread
becomes running
|
|
total_seq
PRTY=2 |
| EVENTS |
FUNCTIONS |
CONSEQUENCES |
| EVT_COND_TOTAL_SEQ_INC |
pthread_cond_wait |
the cond is used by one
more thread
|
|
broadcast_seq
PRTY=2 |
| EVENTS |
FUNCTIONS |
CONSEQUENCES |
| EVT_COND_BROAD_SEQ_INC |
pthread_cond_broadcast |
a broadcast happened
|
|
mutex
PRTY=1
|
| ATTRIBUTES |
EVENTS |
FUNCTIONS |
CONSEQUENCES |
| free |
EVT_COND_MUTEX_FREE
|
pthread_cond_init
pthread_cond_wait |
The mutex becomes free,
any thread can get it
There is no owner for the mutex
|
| taken |
EVT_COND_MUTEX_REQUIER
EVT_COND_MUTEX_TAKEN |
pthread_cond_init
pthread_cond_wait |
The running thread
requieres for the mutex, if it doesn't get the mutex, it becomes blocked
So when the mutex becomes free the thread gets it, then the
thread becomes running
The owner of the mutex doesn't change
|
|
init
PRTY=1 |
| EVENTS |
FUNCTIONS |
CONSEQUENCES |
| EVT_COND_INIT |
pthread_cond_init |
The fields of the cond are
initialized (lock, total_seq, broadcast_seq,mutex).
|
|
destroy
PRTY=1 |
| EVENTS |
FUNCTIONS |
CONSEQUENCES |
| EVT_COND_DESTROY |
pthread_cond_destroy |
The cond is destroyed
|
|