fixed starvation in samples/si/spl01.c

This commit is contained in:
2018-10-29 09:18:30 +00:00
parent 2c02013ec1
commit 388753fcba
2 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@
#include <signal.h>
#include <string.h>
#include <sched.h>
static int g_stopreq = 0;
static qse_ntime_t sleep_interval = { 1, 0 };
@ -33,6 +34,7 @@ static int thr_func (qse_thr_t* thr, void* ctx)
qse_printf (QSE_T("%s: [% 16d] [% 16d] [% 16d]\n"), xtn->name, i, i, i);
qse_spl_unlock (xtn->spl);
i++;
if (!(i % 15)) sched_yield();
/*qse_sleep (&sleep_interval);*/
}