libzypp
13.10.6
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Once.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_THREAD_ONCE_H
13
#define ZYPP_THREAD_ONCE_H
14
15
#include <pthread.h>
16
17
19
namespace
zypp
20
{
21
namespace
thread
23
{
24
25
27
#define ZYPP_ONCE_INIT PTHREAD_ONCE_INIT
28
29
32
typedef
pthread_once_t
OnceFlag
;
33
34
48
void
callOnce
(
OnceFlag
& flag,
void
(*func)());
49
50
inline
void
callOnce
(
OnceFlag
& flag,
void
(*func)())
51
{
52
pthread_once(&flag, func);
53
}
54
56
}
// namespace thread
59
}
// namespace zypp
61
62
#endif // ZYPP_THREAD_ONCE_H
63
/*
64
** vim: set ts=2 sts=2 sw=2 ai et:
65
*/
zypp::thread::OnceFlag
pthread_once_t OnceFlag
The OnceFlag variable type.
Definition:
Once.h:32
zypp::thread::callOnce
void callOnce(OnceFlag &flag, void(*func)())
Call once function.
Definition:
Once.h:50
zypp
thread
Once.h
Generated by
1.8.5