From 9111bc2c2164feeb976e489b4a50111afb11c3fa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2019 22:49:25 +0200 Subject: [PATCH] output/httpd: add more API documentation about locking --- src/output/plugins/httpd/HttpdClient.hxx | 2 ++ src/output/plugins/httpd/HttpdInternal.hxx | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/output/plugins/httpd/HttpdClient.hxx b/src/output/plugins/httpd/HttpdClient.hxx index 296be22da..751d3f2c3 100644 --- a/src/output/plugins/httpd/HttpdClient.hxx +++ b/src/output/plugins/httpd/HttpdClient.hxx @@ -142,6 +142,8 @@ public: /** * Frees the client and removes it from the server's client list. + * + * Caller must lock the mutex. */ void Close() noexcept; diff --git a/src/output/plugins/httpd/HttpdInternal.hxx b/src/output/plugins/httpd/HttpdInternal.hxx index 0bc36f779..d2ac65d02 100644 --- a/src/output/plugins/httpd/HttpdInternal.hxx +++ b/src/output/plugins/httpd/HttpdInternal.hxx @@ -208,10 +208,15 @@ public: return HasClients(); } + /** + * Caller must lock the mutex. + */ void AddClient(UniqueSocketDescriptor fd) noexcept; /** * Removes a client from the httpd_output.clients linked list. + * + * Caller must lock the mutex. */ void RemoveClient(HttpdClient &client) noexcept; @@ -239,10 +244,14 @@ public: /** * Broadcasts data from the encoder to all clients. + * + * Mutext must not be locked. */ void BroadcastFromEncoder(); /** + * Mutext must not be locked. + * * Throws #std::runtime_error on error. */ void EncodeAndPlay(const void *chunk, size_t size); @@ -251,6 +260,9 @@ public: size_t Play(const void *chunk, size_t size) override; + /** + * Mutext must not be locked. + */ void CancelAllClients() noexcept; void Cancel() noexcept override;