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
877a02db
Commit
877a02db
authored
3 years ago
by
Nat Goodspeed
Browse files
Options
Downloads
Patches
Plain Diff
SL-16094: Fix merge glitches from previous revert.
parent
d71e0a6d
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/llthreadsafequeue.h
+11
-8
11 additions, 8 deletions
indra/llcommon/llthreadsafequeue.h
with
11 additions
and
8 deletions
indra/llcommon/llthreadsafequeue.h
+
11
−
8
View file @
877a02db
...
@@ -85,8 +85,8 @@ class LLThreadSafeQueue
...
@@ -85,8 +85,8 @@ class LLThreadSafeQueue
LLThreadSafeQueue
(
U32
capacity
=
1024
);
LLThreadSafeQueue
(
U32
capacity
=
1024
);
virtual
~
LLThreadSafeQueue
()
{}
virtual
~
LLThreadSafeQueue
()
{}
// Add an element to the queue (will block if the queue has
// Add an element to the queue (will block if the queue has
reached
//
reached
capacity).
// capacity).
//
//
// This call will raise an interrupt error if the queue is closed while
// This call will raise an interrupt error if the queue is closed while
// the caller is blocked.
// the caller is blocked.
...
@@ -95,6 +95,11 @@ class LLThreadSafeQueue
...
@@ -95,6 +95,11 @@ class LLThreadSafeQueue
// legacy name
// legacy name
void
pushFront
(
ElementT
const
&
element
)
{
return
push
(
element
);
}
void
pushFront
(
ElementT
const
&
element
)
{
return
push
(
element
);
}
// Add an element to the queue (will block if the queue has reached
// capacity). Return false if the queue is closed before push is possible.
template
<
typename
T
>
bool
pushIfOpen
(
T
&&
element
);
// Try to add an element to the queue without blocking. Returns
// Try to add an element to the queue without blocking. Returns
// true only if the element was actually added.
// true only if the element was actually added.
template
<
typename
T
>
template
<
typename
T
>
...
@@ -314,8 +319,8 @@ bool LLThreadSafeQueue<ElementT, QueueT>::push_(lock_t& lock, T&& element)
...
@@ -314,8 +319,8 @@ bool LLThreadSafeQueue<ElementT, QueueT>::push_(lock_t& lock, T&& element)
template
<
typename
ElementT
,
typename
QueueT
>
template
<
typename
ElementT
,
typename
QueueT
>
template
<
typename
T
>
template
<
typename
T
>
void
LLThreadSafeQueue
<
ElementT
,
QueueT
>::
push
(
T
&&
element
)
bool
LLThreadSafeQueue
<
ElementT
,
QueueT
>::
push
IfOpen
(
T
&&
element
)
{
{
LL_PROFILE_ZONE_SCOPED
;
LL_PROFILE_ZONE_SCOPED
;
lock_t
lock1
(
mLock
);
lock_t
lock1
(
mLock
);
...
@@ -325,12 +330,10 @@ void LLThreadSafeQueue<ElementT, QueueT>::push(T&& element)
...
@@ -325,12 +330,10 @@ void LLThreadSafeQueue<ElementT, QueueT>::push(T&& element)
// drained or not: the moment either end calls close(), further push()
// drained or not: the moment either end calls close(), further push()
// operations will fail.
// operations will fail.
if
(
mClosed
)
if
(
mClosed
)
{
return
false
;
LLTHROW
(
LLThreadSafeQueueInterrupt
());
}
if
(
push_
(
lock1
,
std
::
forward
<
T
>
(
element
)))
if
(
push_
(
lock1
,
std
::
forward
<
T
>
(
element
)))
return
;
return
true
;
// Storage Full. Wait for signal.
// Storage Full. Wait for signal.
mCapacityCond
.
wait
(
lock1
);
mCapacityCond
.
wait
(
lock1
);
...
...
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