Run clang-format
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
template<typename T>
|
||||
void threadsafe_queue<T>::push(T new_value)
|
||||
template <typename T>
|
||||
void
|
||||
threadsafe_queue<T>::push(T new_value)
|
||||
{
|
||||
std::shared_ptr<T> new_data(
|
||||
std::make_shared<T>(std::move(new_value)));
|
||||
std::unique_ptr<node> p(new node);
|
||||
{
|
||||
std::lock_guard<std::mutex> tail_lock(tail_mutex);
|
||||
tail->data=new_data;
|
||||
node* const new_tail=p.get();
|
||||
tail->next=std::move(p);
|
||||
tail=new_tail;
|
||||
}
|
||||
data_cond.notify_one();
|
||||
std::shared_ptr<T> new_data(std::make_shared<T>(std::move(new_value)));
|
||||
std::unique_ptr<node> p(new node);
|
||||
{
|
||||
std::lock_guard<std::mutex> tail_lock(tail_mutex);
|
||||
tail->data = new_data;
|
||||
node* const new_tail = p.get();
|
||||
tail->next = std::move(p);
|
||||
tail = new_tail;
|
||||
}
|
||||
data_cond.notify_one();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user