cerr << __FILE__ << ": real_run." << endl;
#endif // DEBUG
while (!stop) {
+ simulator_mutex.lock();
simulator.simulate();
- Glib::Mutex::Lock lock(transmissions_mutex);
+ simulator_mutex.unlock();
+ transmissions_mutex.lock();
for (TransmitterList::iterator i = transmissions.begin();
i != transmissions.end(); i++) {
(*i)->send(simulator.get_state_as_xml());
}
+ transmissions_mutex.unlock();
Glib::usleep(1000000);
}
}
return false; // No la encontró.
}
+bool Plant::set_open(const std::string& element, bool open) {
+ Glib::Mutex::Lock lock(simulator_mutex);
+ return simulator.set_open(element, open);
+}
+
const string Plant::get_xml(void) const {
ostringstream oss;
try {