Open janwilmans opened 6 years ago
6072f6b8f7a4bce98448f32d4919a0998547f343 is generated with TSS.
1632 is the main thread 1504 is a second worker thread that triggers the sensor.
Why are the Detected and siren on action not deferred to the pump thread?
<external>.console.arm -> .alarm.console.arm [enter] [Disarmed, false] (tid: 1632)
sensor enabled (tid: 1632)
<external>.console.arm <- .alarm.console.arm [leave] [Armed, false] (return) (tid: 1632)
<external>.sensor.triggered -> .alarm.sensor.triggered [deferred] [Armed, false] (tid: 1504)
Detected! (tid: 1504)
siren on! (tid: 1504)
the problem is due to a user error where it was actually possible to call the non-threadsafe methods from outside the threadsafe shell (because those std::function's where public (part of a struct.) it would be good to make them private so this becomes hard to use incorrectly.
All tests were done on the version of Dezyne downloaded from the Dezyne website at Nov 2. 2017.
Generated using dzn service version 2.5.3.
without TSS (thread-safe-shell)
dzn code -l c++ -s AlarmSystem Alarm.dzn
generated two files: Alarm.hh and Alarm.cc
In Alarm.hh:
with TSS (thread-safe-shell)
dzn code -l c++ -s AlarmSystem Alarm.dzn
generated two files: Alarm.hh and Alarm.cc
However, Alarm.cc tried to:
with TSS (thread-safe-shell), but providing the wrong component as System
dzn code -l c++ -s Alarm Alarm.dzn
generated two files: Alarm.hh and Alarm.cc