mirror of
https://github.com/Kistler-Group/sdbus-cpp.git
synced 2025-07-30 18:17:14 +02:00
Little fix of order of destruction in stress tests
This commit is contained in:
@ -737,6 +737,24 @@ PlainMessage createPlainMessage()
|
|||||||
sd_bus* bus_{};
|
sd_bus* bus_{};
|
||||||
} busReferenceKeeper{bus};
|
} busReferenceKeeper{bus};
|
||||||
|
|
||||||
|
// thread_local struct BusKeeper
|
||||||
|
// {
|
||||||
|
// BusKeeper()
|
||||||
|
// {
|
||||||
|
// auto r = sd_bus_open_system(&bus);
|
||||||
|
// sd_bus_flush(bus);
|
||||||
|
// SDBUS_THROW_ERROR_IF(r < 0, "Failed to get default system bus", -r);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ~BusKeeper()
|
||||||
|
// {
|
||||||
|
// sd_bus_flush_close_unref(bus);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// sd_bus* bus{};
|
||||||
|
// internal::SdBus intf;
|
||||||
|
// } busKeeper;
|
||||||
|
|
||||||
// Shelved here as handy thing for potential future tracing purposes:
|
// Shelved here as handy thing for potential future tracing purposes:
|
||||||
//#include <unistd.h>
|
//#include <unistd.h>
|
||||||
//#include <sys/syscall.h>
|
//#include <sys/syscall.h>
|
||||||
|
@ -125,6 +125,7 @@ void Object::finishRegistration()
|
|||||||
void Object::unregister()
|
void Object::unregister()
|
||||||
{
|
{
|
||||||
interfaces_.clear();
|
interfaces_.clear();
|
||||||
|
removeObjectManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbus::Signal Object::createSignal(const std::string& interfaceName, const std::string& signalName)
|
sdbus::Signal Object::createSignal(const std::string& interfaceName, const std::string& signalName)
|
||||||
|
@ -154,12 +154,12 @@ public:
|
|||||||
|
|
||||||
~FahrenheitThermometerAdaptor()
|
~FahrenheitThermometerAdaptor()
|
||||||
{
|
{
|
||||||
unregisterAdaptor();
|
|
||||||
|
|
||||||
exit_ = true;
|
exit_ = true;
|
||||||
cond_.notify_all();
|
cond_.notify_all();
|
||||||
for (auto& worker : workers_)
|
for (auto& worker : workers_)
|
||||||
worker.join();
|
worker.join();
|
||||||
|
|
||||||
|
unregisterAdaptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -264,12 +264,12 @@ public:
|
|||||||
|
|
||||||
~ConcatenatorAdaptor()
|
~ConcatenatorAdaptor()
|
||||||
{
|
{
|
||||||
unregisterAdaptor();
|
|
||||||
|
|
||||||
exit_ = true;
|
exit_ = true;
|
||||||
cond_.notify_all();
|
cond_.notify_all();
|
||||||
for (auto& worker : workers_)
|
for (auto& worker : workers_)
|
||||||
worker.join();
|
worker.join();
|
||||||
|
|
||||||
|
unregisterAdaptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user