BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsls::BslOnce Struct Reference

#include <bsls_bslonce.h>

Public Member Functions

bool enter ()
 
void leave ()
 

Public Attributes

bsls::AtomicOperations::AtomicTypes::Int d_onceState
 

Member Function Documentation

◆ enter()

bool bsls::BslOnce::enter ( )
inline

Enter the one-time block of code. Return true if the one-time block of code has been entered, and false if the one-time block of code has already been executed. If this function returns false then the thread of execution in which enter returned true has already called leave – i.e., the one-time block of code is guaranteed to have completed execution. The behavior is undefined unless this object was originally initialized to BSLS_BSLONCE_INITIALIZER. Note that a successful enter locks a spin-lock; it is imperative that leave be called quickly.

◆ leave()

void bsls::BslOnce::leave ( )
inline

Exit the one-time block of code. The behavior is undefined unless the caller had previously called enter, and enter had returned true.

Member Data Documentation

◆ d_onceState

bsls::AtomicOperations::AtomicTypes::Int bsls::BslOnce::d_onceState

The documentation for this struct was generated from the following file: