diff options
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/ThreadInputStream.cxx | 11 | ||||
-rw-r--r-- | src/input/ThreadInputStream.hxx | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/input/ThreadInputStream.cxx b/src/input/ThreadInputStream.cxx index 2463c7df4..88251a70a 100644 --- a/src/input/ThreadInputStream.cxx +++ b/src/input/ThreadInputStream.cxx @@ -54,10 +54,10 @@ ThreadInputStream::Start() assert(p != nullptr); buffer = new CircularBuffer<uint8_t>((uint8_t *)p, buffer_size); - thread.Start(ThreadFunc, this); + thread.Start(); } -inline void +void ThreadInputStream::ThreadFunc() { FormatThreadName("input:%s", plugin); @@ -108,13 +108,6 @@ ThreadInputStream::ThreadFunc() } void -ThreadInputStream::ThreadFunc(void *ctx) -{ - ThreadInputStream &tis = *(ThreadInputStream *)ctx; - tis.ThreadFunc(); -} - -void ThreadInputStream::Check() { assert(!thread.IsInside()); diff --git a/src/input/ThreadInputStream.hxx b/src/input/ThreadInputStream.hxx index 021bf6e03..046e0821c 100644 --- a/src/input/ThreadInputStream.hxx +++ b/src/input/ThreadInputStream.hxx @@ -73,6 +73,7 @@ public: size_t _buffer_size) :InputStream(_uri, _mutex, _cond), plugin(_plugin), + thread(BIND_THIS_METHOD(ThreadFunc)), buffer_size(_buffer_size) {} virtual ~ThreadInputStream(); @@ -138,7 +139,6 @@ protected: private: void ThreadFunc(); - static void ThreadFunc(void *ctx); }; #endif |