libzypp
13.10.6
|
Classes | |
class | Mutex |
A recursive Mutex. More... | |
class | MutexException |
Exception type thrown on mutex errors. More... | |
class | MutexLock |
Typedefs | |
typedef pthread_mutex_t | RecursiveMutex_t |
typedef pthread_once_t | OnceFlag |
The OnceFlag variable type. More... | |
Functions | |
void | callOnce (OnceFlag &flag, void(*func)()) |
Call once function. More... | |
typedef pthread_mutex_t zypp::thread::RecursiveMutex_t |
typedef pthread_once_t zypp::thread::OnceFlag |
|
inline |
Call once function.
The purpose of callOnce is to ensure that a piece of initialization code is executed at most once. The OnceFlag flag
has to point to a static or extern variable, that was statically initialized to ZYPP_ONCE_INIT.
The first time callOnce is called with a given onceFlag
argument, it calls fuct
with no argument and changes the value of flag
to indicate that the function has been run. Subsequent calls with the same once flag does nothing.