comparison Core/MultiThreading/SharedMessageQueue.cpp @ 3712:2a170a8f1faf

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 15:32:45 +0100
parents 94f4a18a79cc
children
comparison
equal deleted inserted replaced
3709:1f4910999fe7 3712:2a170a8f1faf
33 33
34 #include "../PrecompiledHeaders.h" 34 #include "../PrecompiledHeaders.h"
35 #include "SharedMessageQueue.h" 35 #include "SharedMessageQueue.h"
36 36
37 37
38 #include "../Compatibility.h"
39
38 40
39 /** 41 /**
40 * FIFO (queue): 42 * FIFO (queue):
41 * 43 *
42 * back front 44 * back front
135 return NULL; 137 return NULL;
136 } 138 }
137 } 139 }
138 } 140 }
139 141
140 std::auto_ptr<IDynamicObject> message(queue_.front()); 142 std::unique_ptr<IDynamicObject> message(queue_.front());
141 queue_.pop_front(); 143 queue_.pop_front();
142 144
143 if (queue_.empty()) 145 if (queue_.empty())
144 { 146 {
145 emptied_.notify_all(); 147 emptied_.notify_all();
197 } 199 }
198 else 200 else
199 { 201 {
200 while (!queue_.empty()) 202 while (!queue_.empty())
201 { 203 {
202 std::auto_ptr<IDynamicObject> message(queue_.front()); 204 std::unique_ptr<IDynamicObject> message(queue_.front());
203 queue_.pop_front(); 205 queue_.pop_front();
204 } 206 }
205 207
206 emptied_.notify_all(); 208 emptied_.notify_all();
207 } 209 }