Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
3810145c
Commit
3810145c
authored
5 years ago
by
Nat Goodspeed
Browse files
Options
Downloads
Patches
Plain Diff
DRTVWR-476: Fix first round of compile errors.
parent
72863b94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcommon/llcond.h
+18
-13
18 additions, 13 deletions
indra/llcommon/llcond.h
with
18 additions
and
13 deletions
indra/llcommon/llcond.h
+
18
−
13
View file @
3810145c
...
@@ -39,7 +39,7 @@ template <typename DATA>
...
@@ -39,7 +39,7 @@ template <typename DATA>
class
LLCond
class
LLCond
{
{
public:
public:
typedef
value_type
DATA
;
typedef
DATA
value_type
;
private:
private:
// This is the DATA controlled by the condition_variable.
// This is the DATA controlled by the condition_variable.
...
@@ -56,7 +56,7 @@ class LLCond
...
@@ -56,7 +56,7 @@ class LLCond
public:
public:
/// LLCond can be explicitly initialized with a specific value for mData if
/// LLCond can be explicitly initialized with a specific value for mData if
/// desired.
/// desired.
LLCond
(
value_type
&
&
init
=
value_type
())
:
LLCond
(
const
value_type
&
init
=
value_type
())
:
mData
(
init
)
mData
(
init
)
{}
{}
...
@@ -169,11 +169,16 @@ class LLCond
...
@@ -169,11 +169,16 @@ class LLCond
protected
:
protected
:
// convert F32Milliseconds to a chrono::duration
// convert F32Milliseconds to a chrono::duration
std
::
chrono
::
milliseconds
convert
(
F32Milliseconds
duration
)
auto
convert
(
F32Milliseconds
duration
)
{
{
// extract the F32 milliseconds from F32Milliseconds, construct
// std::chrono::milliseconds doesn't like to be constructed from a
// std::chrono::milliseconds from that value
// float (F32), rubbing our nose in the thought that
return
{
duration
.
value
()
};
// std::chrono::duration::rep is probably integral. Therefore
// converting F32Milliseconds to std::chrono::milliseconds would lose
// precision. Use std::chrono::microseconds instead. Extract the F32
// milliseconds from F32Milliseconds, scale to microseconds, construct
// std::chrono::microseconds from that value.
return
std
::
chrono
::
microseconds
{
std
::
chrono
::
microseconds
::
rep
(
duration
.
value
()
*
1000
)
};
}
}
private
:
private
:
...
@@ -224,31 +229,31 @@ class LLScalarCond: public LLCond<DATA>
...
@@ -224,31 +229,31 @@ class LLScalarCond: public LLCond<DATA>
using
super
=
LLCond
<
DATA
>
;
using
super
=
LLCond
<
DATA
>
;
public:
public:
using
super
::
value_type
;
using
typename
super
::
value_type
;
using
super
::
get
;
using
super
::
get
;
using
super
::
wait
;
using
super
::
wait
;
using
super
::
wait_for
;
using
super
::
wait_for
;
/// LLScalarCond can be explicitly initialized with a specific value for
/// LLScalarCond can be explicitly initialized with a specific value for
/// mData if desired.
/// mData if desired.
LL
Cond
(
value_type
&
&
init
=
value_type
())
:
LL
ScalarCond
(
const
value_type
&
init
=
value_type
())
:
super
(
init
)
super
(
init
)
{}
{}
/// Pass set_one() a new value to which to update mData. set_one() will
/// Pass set_one() a new value to which to update mData. set_one() will
/// lock the mutex, update mData and then call notify_one() on the
/// lock the mutex, update mData and then call notify_one() on the
/// condition_variable.
/// condition_variable.
void
set_one
(
value_type
&
&
value
)
void
set_one
(
const
value_type
&
value
)
{
{
super
::
update_one
([](
value_type
&
data
){
data
=
value
;
});
super
::
update_one
([
&
value
](
value_type
&
data
){
data
=
value
;
});
}
}
/// Pass set_all() a new value to which to update mData. set_all() will
/// Pass set_all() a new value to which to update mData. set_all() will
/// lock the mutex, update mData and then call notify_all() on the
/// lock the mutex, update mData and then call notify_all() on the
/// condition_variable.
/// condition_variable.
void
set_all
(
value_type
&
&
value
)
void
set_all
(
const
value_type
&
value
)
{
{
super
::
update_all
([](
value_type
&
data
){
data
=
value
;
});
super
::
update_all
([
&
value
](
value_type
&
data
){
data
=
value
;
});
}
}
/**
/**
...
@@ -338,7 +343,7 @@ class LLOneShotCond: public LLBoolCond
...
@@ -338,7 +343,7 @@ class LLOneShotCond: public LLBoolCond
using
super
=
LLBoolCond
;
using
super
=
LLBoolCond
;
public:
public:
using
super
::
value_type
;
using
typename
super
::
value_type
;
using
super
::
get
;
using
super
::
get
;
using
super
::
wait
;
using
super
::
wait
;
using
super
::
wait_for
;
using
super
::
wait_for
;
...
...
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