Opened 6 years ago

Last modified 6 years ago

#1467 new change

[Stop using ATL] Convert ATL mutexes to standard library ones.

Reported by: eric@… Assignee:
Priority: P4 Milestone:
Module: Adblock-Plus-for-Internet-Explorer Keywords: ATL
Cc: oleksandr@… Blocked By:
Blocking: #276 Platform: Internet Explorer
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):



The current code uses the ATL class CComAutoCriticalSection. The C++11 standard library provides std::mutex for this purpose.

What to change

Replace CComAutoCriticalSection with std::mutex. As a rule, locking a mutex should be done by std::unique_lock for exception safety.

Change History (3)

comment:1 Changed 6 years ago by sergz

I would recommend to use std::recursive_mutex instead of std::mutex, it's much safer. And std::lock_guard instead of std::unique_lock when it's possible, because in most cases we need the functionality of only lock_guard, so we don't expect anything more, the result is less number of mistakes and better readability. Not sure, but lock_guard can be even lighter.

comment:2 Changed 6 years ago by oleksandr

  • Cc oleksandr@… added
  • Priority changed from Unknown to P5
  • Ready set

comment:3 Changed 6 years ago by oleksandr

  • Priority changed from P5 to P4
Note: See TracTickets for help on using tickets.