Opened 2 years ago

Last modified 22 months ago

#3391 reviewing defect

Detached initialization is defective in corner cases and poorly structured

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

https://codereview.adblockplus.org/29332660/
https://codereview.adblockplus.org/29332665/
https://codereview.adblockplus.org/29334397/

Description

Background

Some classes require long-running initialization and perform it asynchronously in detached threads. CPluginClass performs some process-global initialization. Filters are loaded in a separate thread.

These operations are performed ad hoc and without consistency. Scoping is poor, with control not localized to the classes in which it's relevant. Synchronization is defined at point-of-use rather than within the defining scope of the variables it's initializating. Synchronization in destructors is missing entirely, with possible race conditions in short-lived objects.

What to change

  • Perform detached initialization as close to the data structures being initialized. Scope such initialization code within class definitions when feasible.
  • Provide a consistent way to determine that initialization has completed.
  • Eliminate race conditions in destructors.

Change History (2)

comment:1 Changed 22 months ago by eric@…

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

comment:2 Changed 22 months ago by eric@…

  • Review URL(s) modified (diff)
Note: See TracTickets for help on using tickets.