Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
6d8efa8d
Commit
6d8efa8d
authored
Dec 02, 2016
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store thread_id in tls
parent
343904b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
os.h
include/spdlog/details/os.h
+9
-2
No files found.
include/spdlog/details/os.h
View file @
6d8efa8d
...
...
@@ -294,7 +294,7 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime())
//Return current thread id as size_t
//It exists because the std::this_thread::get_id() is much slower(espcially under VS 2013)
inline
size_t
thread_id
()
inline
size_t
_
thread_id
()
{
#ifdef _WIN32
return
static_cast
<
size_t
>
(
::
GetCurrentThreadId
());
...
...
@@ -310,11 +310,18 @@ inline size_t thread_id()
#else //Default to standard C++11 (OSX and other Unix)
return
static_cast
<
size_t
>
(
std
::
hash
<
std
::
thread
::
id
>
()(
std
::
this_thread
::
get_id
()));
#endif
}
//Return current thread id as size_t (from thread local storage)
inline
size_t
thread_id
()
{
static
thread_local
const
size_t
tid
=
_thread_id
();
return
tid
;
}
// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined)
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
#define SPDLOG_FILENAME_T(s) L ## s
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment