diff --git a/include/crow/app.h b/include/crow/app.h index 0b2d9c333..3c4d87fb1 100644 --- a/include/crow/app.h +++ b/include/crow/app.h @@ -691,7 +691,7 @@ namespace crow { { std::unique_lock lock(start_mutex_); - if (!server_started_) + while (!server_started_) cv_started_.wait(lock); } if (server_) diff --git a/include/crow/http_server.h b/include/crow/http_server.h index c2737d868..d17163263 100644 --- a/include/crow/http_server.h +++ b/include/crow/http_server.h @@ -196,7 +196,7 @@ namespace crow // NOTE: Already documented in "crow/app.h" void wait_for_start() { std::unique_lock lock(start_mutex_); - if (!server_started_) + while (!server_started_) cv_started_.wait(lock); }