Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Use thread_local for thread local storage on non MSVC targets
Browse files Browse the repository at this point in the history
  • Loading branch information
franksinankaya committed Feb 23, 2019
1 parent 313333b commit 8cc2dee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/vm/eventpipebuffermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

#ifdef FEATURE_PERFTRACING

#ifndef __llvm__
#ifndef __GNUC__
__declspec(thread) ThreadEventBufferList ThreadEventBufferList::gCurrentThreadEventBufferList;
#else // !__llvm__
#else // !__GNUC__
thread_local ThreadEventBufferList ThreadEventBufferList::gCurrentThreadEventBufferList;
#endif // !__llvm__
#endif // !__GNUC__

EventPipeBufferManager::EventPipeBufferManager()
{
Expand Down
6 changes: 3 additions & 3 deletions src/vm/eventpipebuffermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class EventPipeBufferList;
// when the thread dies so we can free EventPipeBufferList in the destructor.
class ThreadEventBufferList
{
#ifndef __llvm__
#ifndef __GNUC__
__declspec(thread) static ThreadEventBufferList gCurrentThreadEventBufferList;
#else // !__llvm__
#else // !__GNUC__
thread_local static ThreadEventBufferList gCurrentThreadEventBufferList;
#endif // !__llvm__
#endif // !__GNUC__
EventPipeBufferList * m_pThreadEventBufferList = NULL;
~ThreadEventBufferList();

Expand Down

0 comments on commit 8cc2dee

Please sign in to comment.