ATLAS Offline Software
Loading...
Searching...
No Matches
graphics
JiveXML
JiveXML
ONCRPCThreadCollection.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 JIVEXML_ONCRPCTHREADCOLLECTION_H
6
#define JIVEXML_ONCRPCTHREADCOLLECTION_H
7
8
#include <vector>
9
#include <mutex>
10
#include <pthread.h>
11
#include <semaphore.h>
12
13
namespace
JiveXML
{
14
18
class
ThreadCollection
:
private
std::vector<pthread_t> {
19
20
public
:
21
22
//Constructor
23
ThreadCollection
();
24
25
//Destructor
26
~ThreadCollection
();
27
30
//Add a thread
31
void
AddThread
(
const
pthread_t& thread );
32
33
//Wait till the thread has been added
34
void
WaitAdd
();
35
36
//Remove a thread
37
void
RemoveThread
(
const
pthread_t& thread );
38
39
//Wait for all threads to finish
40
void
JoinAll
();
41
42
//Return number of threads
43
//Can't be const as it requires mutex
44
int
NumberOfThreads
();
46
47
private
:
48
//mutex to assure no conflicts when adding/removing threads
49
std::mutex
m_mutex
;
50
//Semaphore to assure we add all threads
51
sem_t
m_semaphore
;
52
};
53
54
}
55
#endif
56
JiveXML::ThreadCollection::RemoveThread
void RemoveThread(const pthread_t &thread)
Definition
ONCRPCThreadCollection.cxx:49
JiveXML::ThreadCollection::JoinAll
void JoinAll()
Definition
ONCRPCThreadCollection.cxx:76
JiveXML::ThreadCollection::~ThreadCollection
~ThreadCollection()
Definition
ONCRPCThreadCollection.cxx:19
JiveXML::ThreadCollection::m_mutex
std::mutex m_mutex
Definition
ONCRPCThreadCollection.h:49
JiveXML::ThreadCollection::ThreadCollection
ThreadCollection()
Definition
ONCRPCThreadCollection.cxx:11
JiveXML::ThreadCollection::NumberOfThreads
int NumberOfThreads()
Definition
ONCRPCThreadCollection.cxx:105
JiveXML::ThreadCollection::WaitAdd
void WaitAdd()
Definition
ONCRPCThreadCollection.cxx:42
JiveXML::ThreadCollection::m_semaphore
sem_t m_semaphore
Definition
ONCRPCThreadCollection.h:51
JiveXML::ThreadCollection::AddThread
void AddThread(const pthread_t &thread)
Definition
ONCRPCThreadCollection.cxx:28
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition
BadLArRetriever.cxx:22
Generated on
for ATLAS Offline Software by
1.14.0