This class handles a collection of threads.
More...
#include <ONCRPCThreadCollection.h>
This class handles a collection of threads.
Definition at line 17 of file ONCRPCThreadCollection.h.
◆ ThreadCollection()
| JiveXML::ThreadCollection::ThreadCollection |
( |
| ) |
|
◆ ~ThreadCollection()
| JiveXML::ThreadCollection::~ThreadCollection |
( |
| ) |
|
◆ AddThread()
| void JiveXML::ThreadCollection::AddThread |
( |
const pthread_t & | thread | ) |
|
◆ JoinAll()
| void JiveXML::ThreadCollection::JoinAll |
( |
| ) |
|
Definition at line 88 of file ONCRPCThreadCollection.cxx.
88 {
89
90
91
92
93
94
95
96
97 while ( size() > 0 ){
98
99
101
102
103 pthread_t thread = *
begin();
104
105
106 pthread_mutex_unlock(&
m_mutex);
107
108
109 pthread_join(thread,NULL);
110
111
112
114 }
115 }
void RemoveThread(const pthread_t &thread)
◆ NumberOfThreads()
| int JiveXML::ThreadCollection::NumberOfThreads |
( |
| ) |
|
Definition at line 119 of file ONCRPCThreadCollection.cxx.
119 {
120
121
123
124
125 int NThreads = size();
126
127
128 pthread_mutex_unlock(&
m_mutex);
129
130
131 return NThreads;
132 }
◆ RemoveThread()
| void JiveXML::ThreadCollection::RemoveThread |
( |
const pthread_t & | thread | ) |
|
Definition at line 58 of file ONCRPCThreadCollection.cxx.
58 {
59
60
62
63
64 ThreadCollection::iterator threadItr =
begin();
65 while ( threadItr !=
end() ){
66
67 if ( *threadItr == thread ){
68
69 erase(threadItr);
70
71 break ;
72 }
73
74 ++threadItr;
75 }
76
77
79
80
81
82
83 pthread_detach(thread);
84
85 }
◆ WaitAdd()
| void JiveXML::ThreadCollection::WaitAdd |
( |
| ) |
|
◆ elements
| T std::vector< T >::elements |
|
inherited |
◆ m_mutex
| pthread_mutex_t JiveXML::ThreadCollection::m_mutex |
|
private |
◆ m_semaphore
| sem_t JiveXML::ThreadCollection::m_semaphore |
|
private |
The documentation for this class was generated from the following files: