Commit e0a09dbd authored by Max Kellermann's avatar Max Kellermann

input/thread: add "noexcept"

parent 30832ab3
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
ThreadInputStream::ThreadInputStream(const char *_plugin, ThreadInputStream::ThreadInputStream(const char *_plugin,
const char *_uri, const char *_uri,
Mutex &_mutex, Cond &_cond, Mutex &_mutex, Cond &_cond,
size_t _buffer_size) size_t _buffer_size) noexcept
:InputStream(_uri, _mutex, _cond), :InputStream(_uri, _mutex, _cond),
plugin(_plugin), plugin(_plugin),
thread(BIND_THIS_METHOD(ThreadFunc)), thread(BIND_THIS_METHOD(ThreadFunc)),
...@@ -37,7 +37,7 @@ ThreadInputStream::ThreadInputStream(const char *_plugin, ...@@ -37,7 +37,7 @@ ThreadInputStream::ThreadInputStream(const char *_plugin,
allocation.ForkCow(false); allocation.ForkCow(false);
} }
ThreadInputStream::~ThreadInputStream() ThreadInputStream::~ThreadInputStream() noexcept
{ {
{ {
const std::lock_guard<Mutex> lock(mutex); const std::lock_guard<Mutex> lock(mutex);
...@@ -58,8 +58,8 @@ ThreadInputStream::Start() ...@@ -58,8 +58,8 @@ ThreadInputStream::Start()
thread.Start(); thread.Start();
} }
void inline void
ThreadInputStream::ThreadFunc() ThreadInputStream::ThreadFunc() noexcept
{ {
FormatThreadName("input:%s", plugin); FormatThreadName("input:%s", plugin);
......
...@@ -71,9 +71,9 @@ class ThreadInputStream : public InputStream { ...@@ -71,9 +71,9 @@ class ThreadInputStream : public InputStream {
public: public:
ThreadInputStream(const char *_plugin, ThreadInputStream(const char *_plugin,
const char *_uri, Mutex &_mutex, Cond &_cond, const char *_uri, Mutex &_mutex, Cond &_cond,
size_t _buffer_size); size_t _buffer_size) noexcept;
virtual ~ThreadInputStream(); virtual ~ThreadInputStream() noexcept;
/** /**
* Initialize the object and start the thread. * Initialize the object and start the thread.
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
size_t Read(void *ptr, size_t size) override final; size_t Read(void *ptr, size_t size) override final;
protected: protected:
void SetMimeType(const char *_mime) { void SetMimeType(const char *_mime) noexcept {
assert(thread.IsInside()); assert(thread.IsInside());
InputStream::SetMimeType(_mime); InputStream::SetMimeType(_mime);
...@@ -124,7 +124,7 @@ protected: ...@@ -124,7 +124,7 @@ protected:
* *
* The #InputStream is not locked. * The #InputStream is not locked.
*/ */
virtual void Close() {} virtual void Close() noexcept {}
/** /**
* Called from the client thread to cancel a Read() inside the * Called from the client thread to cancel a Read() inside the
...@@ -132,10 +132,10 @@ protected: ...@@ -132,10 +132,10 @@ protected:
* *
* The #InputStream is not locked. * The #InputStream is not locked.
*/ */
virtual void Cancel() {} virtual void Cancel() noexcept {}
private: private:
void ThreadFunc(); void ThreadFunc() noexcept;
}; };
#endif #endif
...@@ -43,7 +43,7 @@ protected: ...@@ -43,7 +43,7 @@ protected:
virtual void Open() override; virtual void Open() override;
virtual size_t ThreadRead(void *ptr, size_t size) override; virtual size_t ThreadRead(void *ptr, size_t size) override;
void Close() override { void Close() noexcept override {
mmsx_close(mms); mmsx_close(mms);
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment