Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d36f1bdb
authored
9 years ago
by
Tobias Schuele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed typos in condition_var_test.cc
parent
3577c136
global_scheduling
…
development
embb375_dataflow_priorities_and_affinities
embb413_network_plugin_improvements
embb428_cuda_plugin
embb453_rwlock
embb456_zip_release_files
embb458_mtapi_initialization
embb499_blocking_data_structures
embb516_thread_sanitizer
embb516_threadsanitizer
embb517_mutex_based_atomics
embb530_linearizability_tester
embb533_worker_thread_os_priorities
embb546_low_performance_on_arm
embb555_blocking_queue
embb556_blocking_stack
embb561_solving_warnings
embb562_install_pdb_files
embb566_blocking_set
embb567_documentation_condition_variable
embb570_blocking_priority_queue
embb571_blocking_map
embb580_extend_changelog
embb581_mtapi_task_wait_timing_fix
embb582_contributing_readme_file
embb603_outdated_headers
embb607_error_with_include_file
embb609_doxygen_warnings
embb_520_prepare_valuepool_for_herlihy_object_pool
embb_525_fix_pool_init_bug
master
v0.4.0
v0.3.2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
base_c/test/condition_var_test.cc
+6
-6
No files found.
base_c/test/condition_var_test.cc
View file @
d36f1bdb
...
...
@@ -38,7 +38,7 @@ ConditionVarTest::ConditionVarTest()
embb_condition_init
(
&
cond_wait_
);
embb_mutex_init
(
&
mutex_cond_wait_
,
EMBB_MUTEX_PLAIN
);
CreateUnit
(
"Timed wait timouts"
)
CreateUnit
(
"Timed wait tim
e
outs"
)
.
Add
(
&
ConditionVarTest
::
TestTimedWaitTimeouts
,
this
);
if
(
num_threads_
>=
2
)
{
CreateUnit
(
"Condition Notify Test"
)
...
...
@@ -64,10 +64,10 @@ void ConditionVarTest::TestNotify() {
while
(
embb_counter_get
(
&
counter_
)
<
static_cast
<
unsigned
int
>
(
num_threads_
-
1
))
{}
//
a
ll threads entered critical section
{}
//
A
ll threads entered critical section
embb_mutex_lock
(
&
mutex_cond_notify_
);
embb_mutex_unlock
(
&
mutex_cond_notify_
);
// All threads called wait on the condition (
E
ven last thread)
// All threads called wait on the condition (
e
ven last thread)
embb_counter_init
(
&
counter_
);
...
...
@@ -75,7 +75,7 @@ void ConditionVarTest::TestNotify() {
embb_mutex_lock
(
&
mutex_cond_wait_
);
embb_condition_wait_for
(
&
cond_wait_
,
&
mutex_cond_wait_
,
&
duration
);
while
(
embb_counter_get
(
&
counter_
)
==
0
)
{}
//
if hangs here signal has not succ
eded
{}
//
If test hangs here, signalling has not succe
eded
PT_ASSERT_EQ_MSG
(
embb_counter_get
(
&
counter_
),
static_cast
<
unsigned
int
>
(
1
),
"Only one thread notified"
);
...
...
@@ -85,7 +85,7 @@ void ConditionVarTest::TestNotify() {
while
(
embb_counter_get
(
&
counter_
)
!=
static_cast
<
unsigned
int
>
(
num_threads_
-
1
))
{}
// If t
his hangs then not all threads were notified.
{}
// If t
est hangs here, not all threads were notified
embb_mutex_unlock
(
&
mutex_cond_wait_
);
embb_mutex_destroy
(
&
mutex_cond_wait_
);
...
...
@@ -111,7 +111,7 @@ void ConditionVarTest::TestTimedWaitTimeouts() {
int
status
=
embb_condition_wait_until
(
&
cond
,
&
mutex
,
&
time
);
PT_EXPECT_EQ
(
status
,
EMBB_TIMEDOUT
);
// Wait for a future timepoint
// Wait for a future time
point
status
=
embb_duration_set_milliseconds
(
&
duration
,
1
);
PT_EXPECT_EQ
(
status
,
EMBB_SUCCESS
);
status
=
embb_time_in
(
&
time
,
&
duration
);
// Time now
...
...
This diff is collapsed.
Click to expand it.
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