]>
Commit | Line | Data |
---|---|---|
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_set_lock: | |
7 | ||
8 | omp_set_lock -- Wait for and set simple lock | |
9 | ******************************************** | |
10 | ||
11 | Description: | |
12 | Before setting a simple lock, the lock variable must be initialized by | |
13 | ``omp_init_lock``. The calling thread is blocked until the lock | |
14 | is available. If the lock is already held by the current thread, | |
15 | a deadlock occurs. | |
16 | ||
17 | C/C++: | |
18 | .. list-table:: | |
19 | ||
20 | * - *Prototype*: | |
21 | - ``void omp_set_lock(omp_lock_t *lock);`` | |
22 | ||
23 | Fortran: | |
24 | .. list-table:: | |
25 | ||
26 | * - *Interface*: | |
27 | - ``subroutine omp_set_lock(svar)`` | |
28 | * - | |
29 | - ``integer(omp_lock_kind), intent(inout) :: svar`` | |
30 | ||
31 | See also: | |
32 | :ref:`omp_init_lock`, :ref:`omp_test_lock`, :ref:`omp_unset_lock` | |
33 | ||
34 | Reference: | |
35 | :openmp:`4.5`, Section 3.3.4. |