Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
8209a45e
Commit
8209a45e
authored
Feb 14, 2015
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add asserts to prevent mysterious hangs in a non-thread-safe gmock build.
parent
b215e30c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
gtest-linked_ptr.h
include/gtest/internal/gtest-linked_ptr.h
+12
-2
No files found.
include/gtest/internal/gtest-linked_ptr.h
View file @
8209a45e
...
@@ -110,7 +110,12 @@ class linked_ptr_internal {
...
@@ -110,7 +110,12 @@ class linked_ptr_internal {
MutexLock
lock
(
&
g_linked_ptr_mutex
);
MutexLock
lock
(
&
g_linked_ptr_mutex
);
linked_ptr_internal
const
*
p
=
ptr
;
linked_ptr_internal
const
*
p
=
ptr
;
while
(
p
->
next_
!=
ptr
)
p
=
p
->
next_
;
while
(
p
->
next_
!=
ptr
)
{
assert
(
p
->
next_
!=
this
&&
"Trying to join() a linked ring we are already in. "
"Is GMock thread safety enabled?"
);
p
=
p
->
next_
;
}
p
->
next_
=
this
;
p
->
next_
=
this
;
next_
=
ptr
;
next_
=
ptr
;
}
}
...
@@ -123,7 +128,12 @@ class linked_ptr_internal {
...
@@ -123,7 +128,12 @@ class linked_ptr_internal {
if
(
next_
==
this
)
return
true
;
if
(
next_
==
this
)
return
true
;
linked_ptr_internal
const
*
p
=
next_
;
linked_ptr_internal
const
*
p
=
next_
;
while
(
p
->
next_
!=
this
)
p
=
p
->
next_
;
while
(
p
->
next_
!=
this
)
{
assert
(
p
->
next_
!=
next_
&&
"Trying to depart() a linked ring we are not in. "
"Is GMock thread safety enabled?"
);
p
=
p
->
next_
;
}
p
->
next_
=
next_
;
p
->
next_
=
next_
;
return
false
;
return
false
;
}
}
...
...
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