Fix race in INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO

BUG=webrtc:7251

Review-Url: https://codereview.webrtc.org/2716343002
Cr-Commit-Position: refs/heads/master@{#16862}
This commit is contained in:
tommi 2017-02-27 05:09:06 -08:00 committed by Commit bot
parent 19854a0053
commit 055ecd1fdf

View File

@ -577,11 +577,8 @@
// Implementation detail: internal macro to create static category.
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category) \
static const unsigned char* INTERNAL_TRACE_EVENT_UID(catstatic) = 0; \
if (!INTERNAL_TRACE_EVENT_UID(catstatic)) { \
INTERNAL_TRACE_EVENT_UID(catstatic) = \
TRACE_EVENT_API_GET_CATEGORY_ENABLED(category); \
}
static const unsigned char* INTERNAL_TRACE_EVENT_UID(catstatic) = \
TRACE_EVENT_API_GET_CATEGORY_ENABLED(category);
// Implementation detail: internal macro to create static category and add
// event if the category is enabled.