Mercurial > hg > orthanc-stone
comparison Platforms/Generic/Oracle.cpp @ 89:f244018a4e4b wasm
BUGGY- trying to remove IVolumeSlicesObserver
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 26 May 2017 18:27:59 +0200 |
parents | 4a541cd4fa83 |
children | 2eca030792aa |
comparison
equal
deleted
inserted
replaced
88:90bf4116a23c | 89:f244018a4e4b |
---|---|
24 #include "../../Resources/Orthanc/Core/Logging.h" | 24 #include "../../Resources/Orthanc/Core/Logging.h" |
25 #include "../../Resources/Orthanc/Core/MultiThreading/SharedMessageQueue.h" | 25 #include "../../Resources/Orthanc/Core/MultiThreading/SharedMessageQueue.h" |
26 #include "../../Resources/Orthanc/Core/OrthancException.h" | 26 #include "../../Resources/Orthanc/Core/OrthancException.h" |
27 | 27 |
28 #include <vector> | 28 #include <vector> |
29 #include <stdio.h> | |
29 | 30 |
30 namespace OrthancStone | 31 namespace OrthancStone |
31 { | 32 { |
32 class Oracle::PImpl | 33 class Oracle::PImpl |
33 { | 34 { |
64 std::auto_ptr<Orthanc::IDynamicObject> item(that->queue_.Dequeue(100)); | 65 std::auto_ptr<Orthanc::IDynamicObject> item(that->queue_.Dequeue(100)); |
65 if (item.get() != NULL) | 66 if (item.get() != NULL) |
66 { | 67 { |
67 IOracleCommand& command = dynamic_cast<IOracleCommand&>(*item); | 68 IOracleCommand& command = dynamic_cast<IOracleCommand&>(*item); |
68 command.Execute(); | 69 command.Execute(); |
70 | |
71 // Random sleeping to test | |
72 //boost::this_thread::sleep(boost::posix_time::milliseconds(50 * (1 + rand() % 10))); | |
69 | 73 |
70 if (that->globalMutex_ != NULL) | 74 if (that->globalMutex_ != NULL) |
71 { | 75 { |
72 boost::mutex::scoped_lock lock(*that->globalMutex_); | 76 boost::mutex::scoped_lock lock(*that->globalMutex_); |
73 command.Commit(); | 77 command.Commit(); |