DragonnetPeer *client;
-static bool finished = false;
+static volatile bool finished = false;
static bool on_recv(unused DragonnetPeer *peer, DragonnetTypeId type, unused void *pkt)
{
while (client_auth.state == AUTH_INIT)
- ;
+ sched_yield();
return (client_auth.state == AUTH_WAIT) == (type == DRAGONNET_TYPE_ToClientAuth);
}
static void on_disconnect(unused DragonnetPeer *peer)
{
interrupted = true;
+
while (! finished)
- ;
+ sched_yield();
}
static void on_ToClientAuth(unused DragonnetPeer *peer, ToClientAuth *pkt)