Next: , Previous: omp_set_nest_lock, Up: Runtime Library Routines

2.27 omp_test_nest_lock – Test and set nested lock if available

Before setting a nested lock, the lock variable must be initialized by omp_init_nest_lock. Contrary to omp_set_nest_lock, omp_test_nest_lock does not block if the lock is not available. If the lock is already held by the current thread, the new nesting count is returned. Otherwise, the return value equals zero.

Prototype: int omp_test_nest_lock(omp_nest_lock_t *lock);


Interface: integer function omp_test_nest_lock(lock)
integer(omp_integer_kind) :: omp_test_nest_lock
integer(omp_nest_lock_kind), intent(inout) :: lock

See also:
omp_init_lock, omp_set_lock, omp_set_lock
OpenMP specifications v3.0, section 3.3.5.