Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
FWCore
Utilities
interface
CallOnceNoWait.h
Go to the documentation of this file.
1
#ifndef FWCore_Utilities_CallOnceNoWait_h
2
#define FWCore_Utilities_CallOnceNoWait_h
3
// -*- C++ -*-
4
//
5
// Package: FWCore/Utilities
6
// Class : CallOnceNoWait
7
//
27
//
28
// Original Author: Chris Jones
29
// Created: Fri, 15 Nov 2013 14:29:51 GMT
30
//
31
32
// system include files
33
#include <atomic>
34
35
// user include files
36
37
// forward declarations
38
39
namespace
edm {
40
class
CallOnceNoWait
41
{
42
public
:
43
CallOnceNoWait
() :
m_called
(
false
) {}
44
45
template
<
typename
T>
46
void
operator()
(
T
iCall) {
47
bool
expected =
false
;
48
if
(
m_called
.compare_exchange_strong(expected,
true
, std::memory_order_acq_rel)) {
49
iCall();
50
}
51
}
52
53
private
:
54
std::atomic<bool>
m_called
;
55
};
56
}
57
58
59
#endif
edm::CallOnceNoWait::m_called
std::atomic< bool > m_called
Definition:
CallOnceNoWait.h:54
edm::CallOnceNoWait
Definition:
CallOnceNoWait.h:40
edm::CallOnceNoWait::CallOnceNoWait
CallOnceNoWait()
Definition:
CallOnceNoWait.h:43
edm::CallOnceNoWait::operator()
void operator()(T iCall)
Definition:
CallOnceNoWait.h:46
edm::false
volatile std::atomic< bool > shutdown_flag false
Definition:
UnixSignalHandlers.cc:22
T
long double T
Definition:
Basic3DVectorLD.h:57
Generated for CMSSW Reference Manual by
1.8.5