File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -38,25 +38,29 @@ AsyncTask::~AsyncTask(){
3838
3939
4040void AsyncTask::report_cancelled () noexcept {
41+ {
4142#ifdef PA_SANITIZE_AsyncTask
42- auto scope = m_sanitizer.check_scope ();
43+ auto scope = m_sanitizer.check_scope ();
4344#endif
44- m_state.store (State::FINISHED, std::memory_order_release);
45- {
46- std::lock_guard<std::mutex> lg (m_lock);
45+ m_state.store (State::FINISHED, std::memory_order_release);
46+ {
47+ std::lock_guard<std::mutex> lg (m_lock);
48+ }
49+ m_cv.notify_all ();
4750 }
48- m_cv.notify_all ();
4951 m_state.store (State::SAFE_TO_DESTRUCT, std::memory_order_release);
5052}
5153void AsyncTask::run () noexcept {
54+ {
5255#ifdef PA_SANITIZE_AsyncTask
53- auto scope = m_sanitizer.check_scope ();
56+ auto scope = m_sanitizer.check_scope ();
5457#endif
55- try {
56- m_task ();
57- }catch (...){
58- std::lock_guard<std::mutex> lg (m_lock);
59- m_exception = std::current_exception ();
58+ try {
59+ m_task ();
60+ }catch (...){
61+ std::lock_guard<std::mutex> lg (m_lock);
62+ m_exception = std::current_exception ();
63+ }
6064 }
6165 report_cancelled ();
6266}
You can’t perform that action at this time.
0 commit comments