summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/server_http.hpp
diff options
context:
space:
mode:
author Christian Brunschen <christian@brunschen.com>2017-07-05 17:27:34 +0100
committer Christian Brunschen <christian@brunschen.com>2017-07-05 17:27:34 +0100
commit0206314395c7dcf7b51311e635588778f6d9cca3 (patch)
treeab242d5e87d9c1f2578edda08c7f150b841831e6 /src/lib/util/server_http.hpp
parent2924e3c17470291a520492d68189dda16e99e2a4 (diff)
Add an external panel for the Ensoniq VFX family of keyboards, with a websocket interface and an HTML/Javascript implementation that can be served over HTTP.
Diffstat (limited to 'src/lib/util/server_http.hpp')
-rw-r--r--src/lib/util/server_http.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/util/server_http.hpp b/src/lib/util/server_http.hpp
index d50ccc05bc7..b50161b1e3b 100644
--- a/src/lib/util/server_http.hpp
+++ b/src/lib/util/server_http.hpp
@@ -199,6 +199,7 @@ namespace webpp {
}
void clear()
{
+ std::lock_guard<std::mutex> lock(m_resource_mutex);
m_resource.clear();
}
@@ -206,12 +207,12 @@ namespace webpp {
std::function<void(std::shared_ptr<socket_type> socket, std::shared_ptr<typename ServerBase<socket_type>::Request>)> on_upgrade;
private:
- /// Warning: do not add or remove resources after start() is called
+ /// Warning: do not access (red or write) m_resources without holding m_resource_mutex
std::map<regex_orderable, std::map<std::string, std::tuple<path2regex::Keys, http_handler>>> m_resource;
+ std::mutex m_resource_mutex;
std::map<std::string, http_handler> m_default_resource;
- std::mutex m_resource_mutex;
public:
virtual void start() {
if(!m_io_context)