Mercurial > hg > orthanc-stone
comparison Platforms/Generic/DelayedCallCommand.cpp @ 754:92c400a09f1b
Merge from default
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 22 May 2019 16:13:46 +0200 |
parents | 4f2416d519b4 |
children | e713f1a99861 1c7ae79c426d |
comparison
equal
deleted
inserted
replaced
753:a386bbc955dc | 754:92c400a09f1b |
---|---|
22 #include "DelayedCallCommand.h" | 22 #include "DelayedCallCommand.h" |
23 #include "boost/thread/thread.hpp" | 23 #include "boost/thread/thread.hpp" |
24 | 24 |
25 #include <iostream> | 25 #include <iostream> |
26 | 26 |
27 namespace OrthancStone | 27 namespace Deprecated |
28 { | 28 { |
29 DelayedCallCommand::DelayedCallCommand(MessageBroker& broker, | 29 DelayedCallCommand::DelayedCallCommand(OrthancStone::MessageBroker& broker, |
30 MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership | 30 OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership |
31 unsigned int timeoutInMs, | 31 unsigned int timeoutInMs, |
32 Orthanc::IDynamicObject* payload /* takes ownership */, | 32 Orthanc::IDynamicObject* payload /* takes ownership */, |
33 NativeStoneApplicationContext& context | 33 OrthancStone::NativeStoneApplicationContext& context |
34 ) : | 34 ) : |
35 IObservable(broker), | 35 IObservable(broker), |
36 callback_(callback), | 36 callback_(callback), |
37 payload_(payload), | 37 payload_(payload), |
38 context_(context), | 38 context_(context), |
53 void DelayedCallCommand::Commit() | 53 void DelayedCallCommand::Commit() |
54 { | 54 { |
55 // We want to make sure that, i.e, the UpdateThread is not | 55 // We want to make sure that, i.e, the UpdateThread is not |
56 // triggered while we are updating the "model" with the result of | 56 // triggered while we are updating the "model" with the result of |
57 // an OracleCommand | 57 // an OracleCommand |
58 NativeStoneApplicationContext::GlobalMutexLocker lock(context_); | 58 OrthancStone::NativeStoneApplicationContext::GlobalMutexLocker lock(context_); |
59 | 59 |
60 if (callback_.get() != NULL) | 60 if (callback_.get() != NULL) |
61 { | 61 { |
62 IDelayedCallExecutor::TimeoutMessage message; // TODO: add payload | 62 IDelayedCallExecutor::TimeoutMessage message; // TODO: add payload |
63 callback_->Apply(message); | 63 callback_->Apply(message); |