]> git.lizzy.rs Git - dragonblocks_alpha.git/blobdiff - src/client/client.c
Fix problems with release build
[dragonblocks_alpha.git] / src / client / client.c
index 88bcded37fa0c1c923b0f5308fb83c14c047601f..80af198a78d513a043143bfe7e589764e5399495 100644 (file)
 
 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);
 }
@@ -29,8 +29,9 @@ static bool on_recv(unused DragonnetPeer *peer, DragonnetTypeId type, unused voi
 static void on_disconnect(unused DragonnetPeer *peer)
 {
        interrupted = true;
+
        while (! finished)
-               ;
+               sched_yield();
 }
 
 static void on_ToClientAuth(unused DragonnetPeer *peer, ToClientAuth *pkt)