LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

omp_test_lock

omp_test_lock

int omp_test_lock (omp_lock_t *lock);

Purpose

Attempts to set a simple OpenMP lock without blocking the execution of the calling thread.

Note Note  The OpenMP Run-Time Library is available only in the LabWindows/CVI Full Development System.

The function returns TRUE if the lock is successfully set and ownership of the lock is granted to the calling thread. Otherwise the function returns FALSE.

Locks you pass to this function must be not be in the unintialized state and locks that are in the locked state must not be owned by the calling thread. The function will return FALSE if called on a lock that is set and owned by the calling thread.

Binding thread set: all threads

Parameters

Input
Name Type Description
lock omp_lock_t * A pointer to a variable of type omp_lock_t. If this function returns TRUE, the lock variable is then in the locked state. Otherwise the state of the lock remains unchanged.

Return Value

Name Type Description
returnValue int Returns TRUE if the lock is successfully set. Otherwise it returns FALSE.

Additional Information

Library: OpenMP Run-Time Library

Include file: omp.h

LabWindows/CVI compatibility: LabWindows/CVI 2013 and later

Was this information helpful?

Help us improve your future ni.com experience.

Did you find the documentation you were looking for?

Submit