ATLAS Offline Software
Loading...
Searching...
No Matches
G4RunToolEventQueue.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef G4RUNMANAGEMENT_G4RUNTOOLEVENTQUEUE_H
6#define G4RUNMANAGEMENT_G4RUNTOOLEVENTQUEUE_H
7
9
10#include <condition_variable>
11#include <cstddef>
12#include <memory>
13#include <mutex>
14#include <queue>
15#include <vector>
16
25{
26 public:
27 using UPEvent = std::unique_ptr<AtlasG4SyncEventUserInfo>;
28
29 std::size_t Size() const;
31 void PushEvent(UPEvent event);
33
35 void Close() noexcept;
36
39 void CompleteOutstandingEvents() noexcept;
40
41 private:
44
47 bool m_closed{false};
48 mutable std::mutex m_mutex;
49 std::condition_variable m_cv;
50};
51
52#endif
Thread-safe event handoff between Athena and the Geant4 worker threads.
std::condition_variable m_cv
void PushEvent(UPEvent event)
Submit a non-null event. Throws std::invalid_argument for null events.
std::queue< UPEvent > m_events
std::weak_ptr< G4EventSynchronizationInterface > WeakSyncInterface
void CompleteOutstandingEvents() noexcept
Release abandoned events and report run termination to their waiters.
std::size_t Size() const
std::unique_ptr< AtlasG4SyncEventUserInfo > UPEvent
std::vector< WeakSyncInterface > m_outstandingEvents
void Close() noexcept
Stop accepting events and wake all Geant4 workers. Idempotent.
STL namespace.
#define private
Definition testRead.cxx:27