[in] ViSession handle for the driver session.
ObtainLock
This macro obtains a thread-based lock for the specified session for the duration of the function in which it is declared.
Syntax
Section titled “Syntax”#define ObtainLock(Vi)Parameters
Section titled “Parameters”Vi
Remarks
Section titled “Remarks”This macro declares a local instance of a special SessionLock class. The constructor of the SessionLock class obtains a session lock on the session indicated by the Vi parameter. When the function containing the ObtainLock macro completes, the SessionLock destructor runs and the session is unlocked.
Example
Section titled “Example”The following example demonstrates use of the ObtainLock macro.
ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency){ ObtainLock(Vi);
// ...}