From 859417e4fe6c80fd2d8860c79e99d79443eedf26 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 5 Apr 2018 21:45:26 +0200 Subject: [PATCH] [DEV] update new etk --- audio/blockEngine/Thread.cpp | 11 +---------- audio/blockEngine/Thread.hpp | 5 ++--- audio/blockEngine/base/ReceiverRiver.cpp | 16 ++++++++-------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/audio/blockEngine/Thread.cpp b/audio/blockEngine/Thread.cpp index f782edd..5848b8b 100644 --- a/audio/blockEngine/Thread.cpp +++ b/audio/blockEngine/Thread.cpp @@ -84,7 +84,7 @@ int32_t audio::blockEngine::Thread::start() { return audio::blockEngine::ERR_FAIL; } m_state = audio::blockEngine::statusCreating; - m_thread = std::make_shared(audio::blockEngine::Thread::genericThreadCall, reinterpret_cast(this)); + m_thread = ememory::makeShared([&]() { threadCall();}); // no else ==> the thread is started corectly... (we think) return audio::blockEngine::ERR_NONE; } @@ -142,15 +142,6 @@ bool audio::blockEngine::Thread::stateStop() { return false; } -void audio::blockEngine::Thread::genericThreadCall(void* _data) { - audio::blockEngine::Thread * self = reinterpret_cast(_data); - if (self != nullptr) { - self->threadCall(); - } else { - ABE_ERROR("can not start th ethraead ..."); - } -} - void audio::blockEngine::Thread::threadCall() { bool autoKill = false; // Endless loop. diff --git a/audio/blockEngine/Thread.hpp b/audio/blockEngine/Thread.hpp index ecf6654..56e8b0c 100644 --- a/audio/blockEngine/Thread.hpp +++ b/audio/blockEngine/Thread.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include