Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
6b4201f9
Commit
6b4201f9
authored
Jan 23, 2019
by
Boris Staletic
Committed by
Derek Mauro
Jan 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GCC8 warnings
parent
0b1e6d41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletions
+25
-1
absl/synchronization/internal/create_thread_identity.cc
+25
-1
No files found.
absl/synchronization/internal/create_thread_identity.cc
View file @
6b4201f9
...
@@ -67,6 +67,30 @@ static intptr_t RoundUp(intptr_t addr, intptr_t align) {
...
@@ -67,6 +67,30 @@ static intptr_t RoundUp(intptr_t addr, intptr_t align) {
return
(
addr
+
align
-
1
)
&
~
(
align
-
1
);
return
(
addr
+
align
-
1
)
&
~
(
align
-
1
);
}
}
static
void
ResetThreadIdentity
(
base_internal
::
ThreadIdentity
*
identity
)
{
base_internal
::
PerThreadSynch
*
pts
=
&
identity
->
per_thread_synch
;
pts
->
next
=
nullptr
;
pts
->
skip
=
nullptr
;
pts
->
may_skip
=
false
;
pts
->
waitp
=
nullptr
;
pts
->
suppress_fatal_errors
=
false
;
pts
->
readers
=
0
;
pts
->
priority
=
0
;
pts
->
next_priority_read_cycles
=
0
;
pts
->
state
.
store
(
base_internal
::
PerThreadSynch
::
State
::
kAvailable
,
std
::
memory_order_relaxed
);
pts
->
maybe_unlocking
=
false
;
pts
->
wake
=
false
;
pts
->
cond_waiter
=
false
;
pts
->
all_locks
=
nullptr
;
identity
->
waiter_state
=
{};
identity
->
blocked_count_ptr
=
nullptr
;
identity
->
ticker
.
store
(
0
,
std
::
memory_order_relaxed
);
identity
->
wait_start
.
store
(
0
,
std
::
memory_order_relaxed
);
identity
->
is_idle
.
store
(
false
,
std
::
memory_order_relaxed
);
identity
->
next
=
nullptr
;
}
static
base_internal
::
ThreadIdentity
*
NewThreadIdentity
()
{
static
base_internal
::
ThreadIdentity
*
NewThreadIdentity
()
{
base_internal
::
ThreadIdentity
*
identity
=
nullptr
;
base_internal
::
ThreadIdentity
*
identity
=
nullptr
;
...
@@ -90,7 +114,7 @@ static base_internal::ThreadIdentity* NewThreadIdentity() {
...
@@ -90,7 +114,7 @@ static base_internal::ThreadIdentity* NewThreadIdentity() {
RoundUp
(
reinterpret_cast
<
intptr_t
>
(
allocation
),
RoundUp
(
reinterpret_cast
<
intptr_t
>
(
allocation
),
base_internal
::
PerThreadSynch
::
kAlignment
));
base_internal
::
PerThreadSynch
::
kAlignment
));
}
}
memset
(
identity
,
0
,
sizeof
(
*
identity
)
);
ResetThreadIdentity
(
identity
);
return
identity
;
return
identity
;
}
}
...
...
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