Opened on 10/08/2014 at 04:18:17 PM

Last modified on 11/18/2014 at 02:58:04 PM

#1467 new change

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

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

Description

Background

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.

Attachments (0)

Change History (3)

comment:1 Changed on 10/08/2014 at 04:55:19 PM 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 on 10/22/2014 at 12:09:29 AM by oleksandr

  • Cc oleksandr@adblockplus.org added
  • Priority changed from Unknown to P5
  • Ready set

comment:3 Changed on 11/18/2014 at 02:58:04 PM by oleksandr

  • Priority changed from P5 to P4

Add Comment

Modify Ticket

Change Properties
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from (none).
Next status will be 'reviewing'.
 
Note: See TracTickets for help on using tickets.