Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
angle
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • angle
  • Repository

Switch branch/tag
  • angle
  • src
  • third_party
  • trace_event
  • trace_event.h
Find file
BlameHistoryPermalink
  • Etienne Bergeron's avatar
    Fix racy GetCategory with trace_event · f8fd9cfb
    Etienne Bergeron authored Jun 09, 2020
    See racy trace_event:
      http://crbug.com/1091723
    
    The trace event macros were racy because of this code:
      INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(...)
    The macro is using a static variable which is not thread-safe.
    The design of tracing was racy (by design) and rely on
    the fact that addTraceEvent(...) is threadsafe internally via
    TraceLog::lock_
    
    This CL is replacing the static variable with a scope (C++11)
    pattern. The static variable is guaranted (C++) to be atomic
    and it is implemented efficiently.
    
    see: §6.7 [stmt.dcl] p4
       " If control enters the declaration concurrently while the
         variable is being initialized, the concurrent execution
         shall wait for completion of the initialization. "
    
    Bug to track follow-up migration:
      http://anglebug.com/4702
    
    Bug: chromium:1091259, chromium:1091723
    Change-Id: If67b501e6e826ccf603eb2349c3f0aa6272c9a52
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2233410
    Commit-Queue: Jamie Madill <jmadill@chromium.org>
    Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    f8fd9cfb
trace_event.h 42.8 KB
EditWeb IDE
×

Replace trace_event.h

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.