annotate Deprecated/Platforms/Generic/Oracle.cpp @ 1442:11f291ac3ef5 legacy-loader-refactoring

This branch is useless.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 26 May 2020 10:11:49 +0200
parents 419d0320c344
children
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
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 956
diff changeset
5 * Copyright (C) 2017-2020 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
212
5412adf19980 resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
24 #include <Core/Logging.h>
5412adf19980 resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
25 #include <Core/MultiThreading/SharedMessageQueue.h>
5412adf19980 resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
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>
271
46c5296d867e OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents: 212
diff changeset
30 #include <boost/thread/mutex.hpp>
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 547
diff changeset
32 namespace Deprecated
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 class Oracle::PImpl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 private:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 enum State
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 State_Init,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 State_Started,
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 State_Stopped
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 };
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
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
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
65 std::unique_ptr<Orthanc::IDynamicObject> item(that->queue_.Dequeue(100));
80
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);
309
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
69 try
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
70 {
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
71 command.Execute();
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
72 }
547
0f43e479b49c Removed old rtstruct demo (correct one on its way) + Many warning fixes (mostly 64-bit ?) + reformat + small fixes + indent (breaking long lines)
Benjamin Golinvaux <bgo@osimis.io>
parents: 439
diff changeset
73 catch (Orthanc::OrthancException& /*ex*/)
309
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
74 {
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
75 // this is probably a curl error that has been triggered. We may just ignore it.
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
76 // The command.success_ will stay at false and this will be handled in the command.Commit
14ef1227120f web services: better handling of failures
am@osimis.io
parents: 271
diff changeset
77 }
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
89
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
79 // Random sleeping to test
f244018a4e4b BUGGY- trying to remove IVolumeSlicesObserver
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
80 //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
81
271
46c5296d867e OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents: 212
diff changeset
82 command.Commit();
80
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:
271
46c5296d867e OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents: 212
diff changeset
88 PImpl(unsigned int threadCount) :
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 state_(State_Init),
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 threads_(threadCount)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 ~PImpl()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 if (state_ == State_Started)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 LOG(ERROR) << "You should have manually called Oracle::Stop()";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 Stop();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
103 Orthanc::SharedMessageQueue& GetQueue()
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
104 {
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
105 return queue_;
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
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 void Submit(IOracleCommand* command)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 {
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
110 std::unique_ptr<IOracleCommand> protection(command);
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 if (command == NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 boost::mutex::scoped_lock lock(oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 switch (state_)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 case State_Init:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 case State_Started:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 queue_.Enqueue(protection.release());
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 case State_Stopped:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 LOG(ERROR) << "Cannot schedule a request to the Oracle after having "
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 << "called Oracle::Stop()";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
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 void Start()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 boost::mutex::scoped_lock lock(oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 if (state_ != State_Init)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 {
956
a7351ad54960 Made IsContextLost automatically set the flag by checking with the emscripten
Benjamin Golinvaux <bgo@osimis.io>
parents: 726
diff changeset
143 LOG(ERROR) << "Oracle::PImpl::Start: (state_ != State_Init)";
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 for (size_t i = 0; i < threads_.size(); i++)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 threads_[i] = new boost::thread(Worker, this);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 state_ = State_Started;
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 void Stop()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 boost::mutex::scoped_lock lock(oracleMutex_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 if (state_ != State_Started)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 {
956
a7351ad54960 Made IsContextLost automatically set the flag by checking with the emscripten
Benjamin Golinvaux <bgo@osimis.io>
parents: 726
diff changeset
162 LOG(ERROR) << "Oracle::PImpl::Stop(): (state_ != State_Started)";
80
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
271
46c5296d867e OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents: 212
diff changeset
185 Oracle::Oracle(unsigned int threadCount) :
46c5296d867e OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents: 212
diff changeset
186 pimpl_(new PImpl(threadCount))
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 {
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 void Oracle::Start()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 pimpl_->Start();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 }
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 void Oracle::Submit(IOracleCommand* command)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 pimpl_->Submit(command);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 void Oracle::Stop()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 pimpl_->Stop();
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 }
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
206
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
207
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
208 void Oracle::WaitEmpty()
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
209 {
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
210 pimpl_->GetQueue().WaitEmpty(50);
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 86
diff changeset
211 }
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 }