Browse Source
Merge pull request #8664 from liamwhite/monkey-compiler-v12-1
common: move forwarded value into SPSCQueue
pull/15/merge
Morph
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/common/threadsafe_queue.h
|
|
@ -39,7 +39,7 @@ public: |
|
|
template <typename Arg> |
|
|
template <typename Arg> |
|
|
void Push(Arg&& t) { |
|
|
void Push(Arg&& t) { |
|
|
// create the element, add it to the queue |
|
|
// create the element, add it to the queue |
|
|
write_ptr->current = std::forward<Arg>(t); |
|
|
|
|
|
|
|
|
write_ptr->current = std::move(t); |
|
|
// set the next pointer to a new element ptr |
|
|
// set the next pointer to a new element ptr |
|
|
// then advance the write pointer |
|
|
// then advance the write pointer |
|
|
ElementPtr* new_ptr = new ElementPtr(); |
|
|
ElementPtr* new_ptr = new ElementPtr(); |
|
|
|