omp_set_lock
- Updated2023-02-21
- 2 minute(s) read
omp_set_lock
void omp_set_lock (omp_lock_t *lock);
Purpose
Sets a simple OpenMP lock. This function blocks the calling thread until the lock is available, sets the lock, and then grants ownership of the lock to the calling thread. A simple lock is available only if it is unlocked.
![]() |
Note The OpenMP Run-Time Library is available only in the LabWindows/CVI Full Development System. |
Locks you pass to this function must not be in the unintialized state. Also, locks you pass to this function that are set must not be owned by the calling thread. Calling this function on a lock that is set and owned by the calling thread causes the program to terminate and an error message prints to stderr.
![]() |
Note Use nestable locks if you want to be able to set a lock more than once from a thread that owns a lock. |
Binding thread set: all threads
Parameters
Input | ||
Name | Type | Description |
lock | omp_lock_t * | A pointer to a variable of type omp_lock_t. After this function returns, the lock variable is in the locked state. |
Return Value
None.
Additional Information
Library: OpenMP Run-Time Library
Include file: omp.h
LabWindows/CVI compatibility: LabWindows/CVI 2013 and later