Parallel Programming Guide for HP-UX Systems

Parallel synchronization
Synchronization tools
Chapter 8140
where (in Fortran)
gate is a gate variable.
where (in C/C++)
gate_p
is a pointer of the indicated type.
Unlocking functions
The unlocking functions release a gate from exclusive access. Gates are
typically released by the thread that locks them, unless a gate was
locked by thread 0 in serial code. In that case it might be unlocked by a
single different thread in a parallel construct.
The form of these unlocking functions is shown in Table 8-5.
where (in Fortran)
gate is a gate variable.
where (in C/C++)
gate_p
is a pointer of the indicated type.
Wait functions
The wait functions use a barrier to cause the calling thread to wait until
the speciļ¬ed number of threads call the function. At this point all
threads are released from the function simultaneously.
Table 8-5 Form of unlocking functions
Language Form
Fortran INTEGER FUNCTION UNLOCK_GATE(gate)
C/C++ int unlock_gate(gate_t *gate_p);