Opened 3 years ago

Closed 3 years ago

#5082 closed defect (fixed)

Possible race condition in DefaultTimer

Reported by: sergz Assignee: sergz
Priority: P2 Milestone:
Module: Libadblockplus Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29402565/

Description

Conditional variable requires that the values changing the return value of predicate are changed with acquired lock.
http://en.cppreference.com/w/cpp/thread/condition_variable

What to change

So far, simply moving assignment of shouldThreadStop member in destructor to a scope with std::lock_guard is enough.

Change History (5)

comment:1 Changed 3 years ago by sergz

  • Owner set to sergz

comment:2 Changed 3 years ago by sergz

  • Summary changed from Possble race conditon in DefaultTimer to Possible race condition in DefaultTimer

comment:3 Changed 3 years ago by sergz

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 5082 - fix possible race condition in DefaultTimer

comment:5 Changed 3 years ago by sergz

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.