mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
(coop_next_runnable_thread): Removed, wich should have happened when
GUILE_ISELECT was hard-wired.
This commit is contained in:
parent
1e5f92cef1
commit
79796da5b5
1 changed files with 1 additions and 35 deletions
|
@ -40,7 +40,7 @@
|
||||||
* If you do not wish that, delete this exception notice. */
|
* If you do not wish that, delete this exception notice. */
|
||||||
|
|
||||||
|
|
||||||
/* $Id: coop.c,v 1.33 2002-11-03 22:05:10 mvo Exp $ */
|
/* $Id: coop.c,v 1.34 2002-11-04 15:43:00 mvo Exp $ */
|
||||||
|
|
||||||
/* Cooperative thread library, based on QuickThreads */
|
/* Cooperative thread library, based on QuickThreads */
|
||||||
|
|
||||||
|
@ -223,40 +223,6 @@ coop_init ()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the next runnable thread. If no threads are currently runnable,
|
|
||||||
and there are sleeping threads - wait until one wakes up. Otherwise,
|
|
||||||
return NULL. */
|
|
||||||
|
|
||||||
coop_t *
|
|
||||||
coop_next_runnable_thread()
|
|
||||||
{
|
|
||||||
int sleepers;
|
|
||||||
coop_t *t;
|
|
||||||
time_t now;
|
|
||||||
|
|
||||||
do {
|
|
||||||
sleepers = 0;
|
|
||||||
now = time(NULL);
|
|
||||||
|
|
||||||
/* Check the sleeping queue */
|
|
||||||
while ((t = coop_qget(&coop_global_sleepq)) != NULL)
|
|
||||||
{
|
|
||||||
sleepers++;
|
|
||||||
if (t->wakeup_time <= now)
|
|
||||||
coop_qput(&coop_global_runq, t);
|
|
||||||
else
|
|
||||||
coop_qput(&coop_tmp_queue, t);
|
|
||||||
}
|
|
||||||
while ((t = coop_qget(&coop_tmp_queue)) != NULL)
|
|
||||||
coop_qput(&coop_global_sleepq, t);
|
|
||||||
|
|
||||||
t = coop_qget (&coop_global_runq);
|
|
||||||
|
|
||||||
} while ((t == NULL) && (sleepers > 0));
|
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
coop_start()
|
coop_start()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue