Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemCore
Commits
2983d271
Commit
2983d271
authored
May 3, 2017
by
Josh Gao
Committed by
Gerrit Code Review
May 3, 2017
Browse files
Options
Downloads
Plain Diff
Merge "adb: enable -Wthread-safety on linux/darwin."
parents
e1e3e203
68f679c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
adb/Android.mk
+6
-2
6 additions, 2 deletions
adb/Android.mk
adb/sysdeps_test.cpp
+0
-49
0 additions, 49 deletions
adb/sysdeps_test.cpp
with
6 additions
and
51 deletions
adb/Android.mk
+
6
−
2
View file @
2983d271
...
...
@@ -17,11 +17,15 @@ ADB_COMMON_CFLAGS := \
-Wvla
\
-DADB_REVISION
=
'"
$(
adb_version
)
"'
\
ADB_COMMON_
linu
x_CFLAGS
:=
\
ADB_COMMON_
posi
x_CFLAGS
:=
\
-Wexit-time-destructors
\
-Wthread-safety
ADB_COMMON_linux_CFLAGS
:=
\
$(
ADB_COMMON_posix_CFLAGS
)
\
ADB_COMMON_darwin_CFLAGS
:=
\
-Wexit-time-destructors
\
$(
ADB_COMMON_posix_CFLAGS
)
\
# Define windows.h and tchar.h Unicode preprocessor symbols so that
# CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the
...
...
This diff is collapsed.
Click to expand it.
adb/sysdeps_test.cpp
+
0
−
49
View file @
2983d271
...
...
@@ -201,55 +201,6 @@ TEST_F(sysdeps_poll, fd_count) {
}
}
TEST
(
sysdeps_mutex
,
mutex_smoke
)
{
static
std
::
atomic
<
bool
>
finished
(
false
);
static
std
::
mutex
&
m
=
*
new
std
::
mutex
();
m
.
lock
();
ASSERT_FALSE
(
m
.
try_lock
());
std
::
thread
thread
([]()
{
ASSERT_FALSE
(
m
.
try_lock
());
m
.
lock
();
finished
.
store
(
true
);
std
::
this_thread
::
sleep_for
(
200ms
);
m
.
unlock
();
});
ASSERT_FALSE
(
finished
.
load
());
std
::
this_thread
::
sleep_for
(
100ms
);
ASSERT_FALSE
(
finished
.
load
());
m
.
unlock
();
std
::
this_thread
::
sleep_for
(
100ms
);
m
.
lock
();
ASSERT_TRUE
(
finished
.
load
());
m
.
unlock
();
thread
.
join
();
}
TEST
(
sysdeps_mutex
,
recursive_mutex_smoke
)
{
static
std
::
recursive_mutex
&
m
=
*
new
std
::
recursive_mutex
();
m
.
lock
();
ASSERT_TRUE
(
m
.
try_lock
());
m
.
unlock
();
std
::
thread
thread
([]()
{
ASSERT_FALSE
(
m
.
try_lock
());
m
.
lock
();
std
::
this_thread
::
sleep_for
(
500ms
);
m
.
unlock
();
});
std
::
this_thread
::
sleep_for
(
100ms
);
m
.
unlock
();
std
::
this_thread
::
sleep_for
(
100ms
);
ASSERT_FALSE
(
m
.
try_lock
());
m
.
lock
();
m
.
unlock
();
thread
.
join
();
}
TEST
(
sysdeps_condition_variable
,
smoke
)
{
static
std
::
mutex
&
m
=
*
new
std
::
mutex
;
static
std
::
condition_variable
&
cond
=
*
new
std
::
condition_variable
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment