Page MenuHomec4science

Synchronizer.cpp
No OneTemporary

File Metadata

Created
Fri, May 24, 06:35

Synchronizer.cpp

#include "Synchronizer.h"
#include <stdexcept>
using namespace std;
namespace rci {
namespace oncilla {
Synchronizer::Synchronizer(const std::string &sname)
: ::rci::Synchronizer(sname)
, d_inProcess(false){
}
Synchronizer::~Synchronizer() {
}
bool Synchronizer::start(){
d_inProcess = false;
return rci::Synchronizer::start();
}
void Synchronizer::processAsync(){
if(!tooBusy()){
start();
}
if(d_inProcess){
throw std::logic_error("Previous processing is not terminated.");
} else {
d_inProcess = true;
}
ProcessAsyncPrimpl();
}
void Synchronizer::waitForProcessAsync(){
if(!tooBusy()){
start();
}
if(!d_inProcess){
//just do nothing, since nothing to do;
return;
}
WaitForProcessAsyncPrimpl();
d_inProcess = false;
}
}
}

Event Timeline