reset queue when restart

This commit is contained in:
Xisco Bosch 2017-03-24 12:02:29 +01:00
parent 53e11ccbed
commit 457d74bb7a
5 changed files with 22 additions and 0 deletions

View File

@ -251,6 +251,11 @@ namespace server {
void CarlaCommunication::sendWorld(const uint32_t modes,const uint32_t scenes) {
//ClearThreads
_worldThread.clear();
_clientThread.clear();
_serverThread.clear();
World world;
_proto->LoadWorld(world, modes, scenes);

View File

@ -71,6 +71,11 @@ namespace thread {
return _restart;
}
void clear(){
_readQueue.clear();
_writeQueue.clear();
}
private:
void workerThread() {

View File

@ -54,6 +54,10 @@ namespace thread {
void reconnect(){
_reconnectJob();
}
void clear(){
_queue.clear();
}
private:
void workerThread() {

View File

@ -53,6 +53,10 @@ namespace thread {
_reconnectJob();
}
void clear(){
_queue.clear();
}
private:
void workerThread() {

View File

@ -63,6 +63,10 @@ namespace thread {
}*/
}
void clear(){
_value = nullptr;
}
bool empty() const {
std::lock_guard<std::mutex> lock(_mutex);
//return _queue.empty();