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