Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
glog
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
glog
Commits
4d6aff41
Unverified
Commit
4d6aff41
authored
Nov 02, 2019
by
Sergiu Deitsch
Committed by
GitHub
Nov 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #477 from ffontaine/master
src/utilities: fix build without pthread
parents
fd3dc2c6
9630e0e8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
15 deletions
+3
-15
utilities.cc
src/utilities.cc
+3
-13
utilities.h
src/utilities.h
+0
-2
No files found.
src/utilities.cc
View file @
4d6aff41
...
...
@@ -61,7 +61,6 @@ using std::string;
_START_GOOGLE_NAMESPACE_
static
const
char
*
g_program_invocation_short_name
=
NULL
;
static
pthread_t
g_main_thread_id
;
_END_GOOGLE_NAMESPACE_
...
...
@@ -181,16 +180,6 @@ bool IsGoogleLoggingInitialized() {
return
g_program_invocation_short_name
!=
NULL
;
}
bool
is_default_thread
()
{
if
(
g_program_invocation_short_name
==
NULL
)
{
// InitGoogleLogging() not yet called, so unlikely to be in a different
// thread
return
true
;
}
else
{
return
pthread_equal
(
pthread_self
(),
g_main_thread_id
);
}
}
#ifdef OS_WINDOWS
struct
timeval
{
long
tv_sec
,
tv_usec
;
...
...
@@ -276,9 +265,11 @@ pid_t GetTID() {
return
getpid
();
// Linux: getpid returns thread ID when gettid is absent
#elif defined OS_WINDOWS && !defined OS_CYGWIN
return
GetCurrentThreadId
();
#el
se
#el
if defined(HAVE_PTHREAD)
// If none of the techniques above worked, we use pthread_self().
return
(
pid_t
)(
uintptr_t
)
pthread_self
();
#else
return
-
1
;
#endif
}
...
...
@@ -350,7 +341,6 @@ void InitGoogleLoggingUtilities(const char* argv0) {
if
(
!
slash
)
slash
=
strrchr
(
argv0
,
'\\'
);
#endif
g_program_invocation_short_name
=
slash
?
slash
+
1
:
argv0
;
g_main_thread_id
=
pthread_self
();
#ifdef HAVE_STACKTRACE
InstallFailureFunction
(
&
DumpStackTraceAndExit
);
...
...
src/utilities.h
View file @
4d6aff41
...
...
@@ -163,8 +163,6 @@ const char* ProgramInvocationShortName();
bool
IsGoogleLoggingInitialized
();
bool
is_default_thread
();
int64
CycleClock_Now
();
int64
UsecToCycles
(
int64
usec
);
...
...
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