mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5095 from c1728p9/timer_sleep_lock_fix
Release deep sleep lock in destructor of Timer classpull/5205/merge
commit
8508d26ea2
|
@ -28,6 +28,15 @@ Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer::~Timer() {
|
||||||
|
core_util_critical_section_enter();
|
||||||
|
if (_running) {
|
||||||
|
sleep_manager_unlock_deep_sleep();
|
||||||
|
}
|
||||||
|
_running = 0;
|
||||||
|
core_util_critical_section_exit();
|
||||||
|
}
|
||||||
|
|
||||||
void Timer::start() {
|
void Timer::start() {
|
||||||
core_util_critical_section_enter();
|
core_util_critical_section_enter();
|
||||||
if (!_running) {
|
if (!_running) {
|
||||||
|
|
|
@ -53,6 +53,7 @@ class Timer : private NonCopyable<Timer> {
|
||||||
public:
|
public:
|
||||||
Timer();
|
Timer();
|
||||||
Timer(const ticker_data_t *data);
|
Timer(const ticker_data_t *data);
|
||||||
|
~Timer();
|
||||||
|
|
||||||
/** Start the timer
|
/** Start the timer
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue