ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaBaseComps
src
AthAsynchronousAlgorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
// AthAsynchronousAlgorithm.cxx
5
// Implementation file for class AthAsynchronousAlgorithm
6
// Author: Beojan Stanislaus
7
8
#include "
AthenaBaseComps/AthAsynchronousAlgorithm.h
"
9
#include "
CxxUtils/checker_macros.h
"
10
#include <print>
11
12
StatusCode
AthAsynchronousAlgorithm::sysExecute
(
const
EventContext& ctx) {
13
ATH_MSG_VERBOSE
(
"Starting sysExecute for AthAsynchronousAlgorithm on slot {}"
,
14
ctx.slot());
15
if
(m_currentCtx.get() ==
nullptr
) {
16
// const_cast because fiber_specific_ptr doesn't support const pointers
17
// The const is never actually violated
18
EventContext* ctx_temp
ATLAS_THREAD_SAFE
=
const_cast<
EventContext*
>
(&ctx);
19
m_currentCtx.reset(ctx_temp);
20
}
else
if
(m_currentCtx->evt() != ctx.evt() ||
21
m_currentCtx->slot() != ctx.slot()) {
22
ATH_MSG_ERROR
(
"m_currentCtx is set to {} (slot {}) but incorrect. "
23
"It should be {} (slot {})"
,
24
m_currentCtx->evt(), m_currentCtx->slot(),
25
ctx.evt(), ctx.slot());
26
return
StatusCode::FAILURE;
27
}
28
return
Gaudi::AsynchronousAlgorithm::sysExecute(ctx);
29
}
30
31
StatusCode
AthAsynchronousAlgorithm::restoreAfterSuspend
()
const
{
32
auto
* currentCtx = m_currentCtx.get();
33
ATH_MSG_DEBUG
(
"Setting current context to {}"
,
static_cast<
void
*
>
(currentCtx));
34
Gaudi::Hive::setCurrentContext(currentCtx);
35
return
StatusCode::SUCCESS;
36
}
AthAsynchronousAlgorithm.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x,...)
Definition
AthMsgStreamMacros.h:42
checker_macros.h
Define macros for attributes used to control the static checker.
AthAsynchronousAlgorithm::restoreAfterSuspend
virtual StatusCode restoreAfterSuspend() const override
Restore after suspend.
Definition
AthAsynchronousAlgorithm.cxx:31
AthAsynchronousAlgorithm::sysExecute
StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition
AthAsynchronousAlgorithm.cxx:12
AthAsynchronousAlgorithm::ATLAS_THREAD_SAFE
boost::fibers::fiber_specific_ptr< EventContext > m_currentCtx ATLAS_THREAD_SAFE
Pointer to current context.
Definition
AthAsynchronousAlgorithm.h:43
Generated on
for ATLAS Offline Software by
1.17.0