Add raop_is_running function.
[deb_shairplay.git] / src / lib / httpd.c
index 8a3844329d86fde041d4d83b14182e7ff7a2076b..0dbc84776caf8b5383ac7e90718ff3055bcb098f 100644 (file)
@@ -336,6 +336,20 @@ httpd_start(httpd_t *httpd, unsigned short *port)
        return 1;
 }
 
+int
+httpd_is_running(httpd_t *httpd)
+{
+       int running;
+
+       assert(httpd);
+
+       MUTEX_LOCK(httpd->run_mutex);
+       running = httpd->running || !httpd->joined;
+       MUTEX_UNLOCK(httpd->run_mutex);
+
+       return running;
+}
+
 void
 httpd_stop(httpd_t *httpd)
 {