File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515// *****************************************************************************
1616#include " shutdown_state.hpp"
1717
18+ #include < atomic>
19+
1820namespace {
19- volatile std::sig_atomic_t shutdown_request = 0 ;
20- volatile std::sig_atomic_t ovms_exited = 0 ;
21+ std::atomic< int > shutdown_request{ 0 } ;
22+ std::atomic< int > ovms_exited{ 0 } ;
2123} // namespace
2224
2325namespace ovms {
2426int getShutdownRequestValue () {
25- return shutdown_request;
27+ return shutdown_request. load (std::memory_order_relaxed) ;
2628}
2729
2830void setShutdownRequestValue (int value) {
29- shutdown_request = value;
31+ shutdown_request. store ( value, std::memory_order_relaxed) ;
3032}
3133
3234int getExitStatusValue () {
33- return ovms_exited;
35+ return ovms_exited. load (std::memory_order_relaxed) ;
3436}
3537
3638void setExitStatusValue (int value) {
37- ovms_exited = value;
39+ ovms_exited. store ( value, std::memory_order_relaxed) ;
3840}
3941} // namespace ovms
You can’t perform that action at this time.
0 commit comments