]> git.pond.sub.org Git - empserver/commitdiff
Make execute yield the processor after every command
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 Jan 2012 07:41:54 +0000 (08:41 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 20 Feb 2012 06:44:21 +0000 (07:44 +0100)
A player sending execute script contents quickly could theoretically
get an unfair share of the server.  Missed in commit db6fd8da
(v4.2.22), which made only the normal command loop yield.

src/lib/player/player.c

index c770c55388ae646f2c19df4043ad729d715bcc1b..6e568882f83073b5e59440ad217ca7bcb3729f2b 100644 (file)
@@ -260,6 +260,7 @@ execute(void)
            failed = 1;
        } else if (dispatch(buf, NULL) < 0)
            failed = 1;
+       empth_yield();
     }
     if (failed) {
        while (recvclient(buf, sizeof(buf)) >= 0) ;