]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. _omp_test_nest_lock: | |
7 | ||
8 | omp_test_nest_lock -- Test and set nested lock if available | |
9 | *********************************************************** | |
10 | ||
11 | Description: | |
12 | Before setting a nested lock, the lock variable must be initialized by | |
13 | ``omp_init_nest_lock``. Contrary to ``omp_set_nest_lock``, | |
14 | ``omp_test_nest_lock`` does not block if the lock is not available. | |
15 | If the lock is already held by the current thread, the new nesting count | |
16 | is returned. Otherwise, the return value equals zero. | |
17 | ||
18 | C/C++: | |
19 | .. list-table:: | |
20 | ||
21 | * - *Prototype*: | |
22 | - ``int omp_test_nest_lock(omp_nest_lock_t *lock);`` | |
23 | ||
24 | Fortran: | |
25 | .. list-table:: | |
26 | ||
27 | * - *Interface*: | |
28 | - ``logical function omp_test_nest_lock(nvar)`` | |
29 | * - | |
30 | - ``integer(omp_nest_lock_kind), intent(inout) :: nvar`` | |
31 | ||
32 | See also: | |
33 | :ref:`omp_init_lock`, :ref:`omp_set_lock`, :ref:`omp_set_lock` | |
34 | ||
35 | Reference: | |
3ed1b4ce | 36 | :openmp:`4.5`, Section 3.3.6. |