annotate Platforms/Generic/Oracle.cpp @ 150:62670cc2bb50 wasm

print matrix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Feb 2018 16:07:54 +0100
parents e2fe9352f240
children e9c7a78a3e77
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
135
e2fe9352f240 upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #include "Oracle.h"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
113
2eca030792aa using the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
24 #include <Core/Logging.h>
2eca030792aa using the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
25 #include <Core/MultiThreading/SharedMessageQueue.h>
2eca030792aa using the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
26 #include <Core/OrthancException.h>
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <vector>
89
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
29 #include <stdio.h>
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancStone
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class Oracle::PImpl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 enum State
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 State_Init,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 State_Started,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 State_Stopped
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 };
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 boost::mutex* globalMutex_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 boost::mutex oracleMutex_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 State state_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 std::vector<boost::thread*> threads_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 Orthanc::SharedMessageQueue queue_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 static void Worker(PImpl* that)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 for (;;)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 State state;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 boost::mutex::scoped_lock lock(that->oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 state = that->state_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 if (state == State_Stopped)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 std::auto_ptr<Orthanc::IDynamicObject> item(that->queue_.Dequeue(100));
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 if (item.get() != NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 IOracleCommand& command = dynamic_cast<IOracleCommand&>(*item);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 command.Execute();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
89
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
71 // Random sleeping to test
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
72 //boost::this_thread::sleep(boost::posix_time::milliseconds(50 * (1 + rand() % 10)));
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
73
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 if (that->globalMutex_ != NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 boost::mutex::scoped_lock lock(*that->globalMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 command.Commit();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 else
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 command.Commit();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 public:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 PImpl(boost::mutex* globalMutex,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 unsigned int threadCount) :
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 globalMutex_(globalMutex),
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 state_(State_Init),
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 threads_(threadCount)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 ~PImpl()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 if (state_ == State_Started)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 LOG(ERROR) << "You should have manually called Oracle::Stop()";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 Stop();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
105 Orthanc::SharedMessageQueue& GetQueue()
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
106 {
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
107 return queue_;
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
108 }
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
109
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 void Submit(IOracleCommand* command)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 std::auto_ptr<IOracleCommand> protection(command);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 if (command == NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 boost::mutex::scoped_lock lock(oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 switch (state_)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 case State_Init:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 case State_Started:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 queue_.Enqueue(protection.release());
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 case State_Stopped:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 LOG(ERROR) << "Cannot schedule a request to the Oracle after having "
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 << "called Oracle::Stop()";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 void Start()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 boost::mutex::scoped_lock lock(oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 if (state_ != State_Init)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 for (size_t i = 0; i < threads_.size(); i++)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 threads_[i] = new boost::thread(Worker, this);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 state_ = State_Started;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 void Stop()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 boost::mutex::scoped_lock lock(oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 if (state_ != State_Started)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 state_ = State_Stopped;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 for (size_t i = 0; i < threads_.size(); i++)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 if (threads_[i] != NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 if (threads_[i]->joinable())
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 threads_[i]->join();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 delete threads_[i];
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 };
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 Oracle::Oracle(boost::mutex& globalMutex,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 unsigned int threadCount) :
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 pimpl_(new PImpl(&globalMutex, threadCount))
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 Oracle::Oracle(unsigned int threadCount) :
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 pimpl_(new PImpl(NULL, threadCount))
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 void Oracle::Start()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 pimpl_->Start();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 void Oracle::Submit(IOracleCommand* command)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 pimpl_->Submit(command);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 void Oracle::Stop()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 pimpl_->Stop();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 }
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
214
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
215
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
216 void Oracle::WaitEmpty()
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
217 {
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
218 pimpl_->GetQueue().WaitEmpty(50);
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
219 }
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 }