diff --git a/examples/HelloWorldThreaded.cpp b/examples/HelloWorldThreaded.cpp index a1bc734..16ebfb1 100644 --- a/examples/HelloWorldThreaded.cpp +++ b/examples/HelloWorldThreaded.cpp @@ -1,6 +1,9 @@ #include "App.h" #include #include +#include + +std::mutex m; int main() { /* Overly simple hello world app, using multiple threads */ @@ -12,11 +15,13 @@ int main() { uWS::App().get("/*", [](auto *res, auto * /*req*/) { res->end("Hello world!"); }).listen(3000, [](auto *listen_socket) { + m.lock(); if (listen_socket) { std::cout << "Thread " << std::this_thread::get_id() << " listening on port " << 3000 << std::endl; } else { std::cout << "Thread " << std::this_thread::get_id() << " failed to listen on port 3000" << std::endl; } + m.unlock(); }).run(); }); diff --git a/uSockets b/uSockets index 2b96d4b..c1af42e 160000 --- a/uSockets +++ b/uSockets @@ -1 +1 @@ -Subproject commit 2b96d4b517fd59cec1438287fa6fcf3bd9c32e17 +Subproject commit c1af42e6572e0a57dba6b904519d4d373d97e0aa