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:
parent
44669a748d
commit
1e3980f034
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue