Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
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
Branches containing commit
No related tags found
Tags containing commit
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>
class
LLCond
{
public:
typedef
value_type
DATA
;
typedef
DATA
value_type
;
private:
// This is the DATA controlled by the condition_variable.
...
...
@@ -56,7 +56,7 @@ class LLCond
public:
/// LLCond can be explicitly initialized with a specific value for mData if
/// desired.
LLCond
(
value_type
&
&
init
=
value_type
())
:
LLCond
(
const
value_type
&
init
=
value_type
())
:
mData
(
init
)
{}
...
...
@@ -169,11 +169,16 @@ class LLCond
protected
:
// 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 from that value
return
{
duration
.
value
()
};
// std::chrono::milliseconds doesn't like to be constructed from a
// float (F32), rubbing our nose in the thought that
// 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
:
...
...
@@ -224,31 +229,31 @@ class LLScalarCond: public LLCond<DATA>
using
super
=
LLCond
<
DATA
>
;
public:
using
super
::
value_type
;
using
typename
super
::
value_type
;
using
super
::
get
;
using
super
::
wait
;
using
super
::
wait_for
;
/// LLScalarCond can be explicitly initialized with a specific value for
/// mData if desired.
LL
Cond
(
value_type
&
&
init
=
value_type
())
:
LL
ScalarCond
(
const
value_type
&
init
=
value_type
())
:
super
(
init
)
{}
/// 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
/// 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
/// lock the mutex, update mData and then call notify_all() on the
/// 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
using
super
=
LLBoolCond
;
public:
using
super
::
value_type
;
using
typename
super
::
value_type
;
using
super
::
get
;
using
super
::
wait
;
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