1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix the race in web startup differently

This commit is contained in:
Steffen Vogel 2017-05-14 11:36:44 +02:00
parent 44669a748d
commit 1e3980f034

View file

@ -143,8 +143,6 @@ static void * worker(void *ctx)
{
struct web *w = ctx;
assert(w->state == STATE_STARTED);
for (;;)
lws_service(w->context, 100);
@ -223,11 +221,11 @@ int web_start(struct web *w)
error("WebSocket: failed to initialize server");
}
w->state = STATE_STARTED;
ret = pthread_create(&w->thread, NULL, worker, w);
if (ret)
error("Failed to start Web worker");
w->state = STATE_STARTED;
return ret;
}