1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Replaced GUILE_ISELECT with

USE_COOP_THREADS.
(scm_internal_select): Define one version for USE_COOP_THREADS and
one for USE_NULL_THREADS.
(scm_init_iselect): Likewise.
This commit is contained in:
Marius Vollmer 2002-10-27 20:13:10 +00:00
parent b1e945d7ec
commit 1d0bde44b7
2 changed files with 31 additions and 14 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,7 +53,7 @@
#include "libguile/iselect.h"
#ifdef GUILE_ISELECT
#ifdef USE_COOP_THREADS
#include "libguile/coop-threads.h"
@ -623,8 +623,6 @@ scm_init_iselect ()
#include "libguile/iselect.x"
}
#endif /* GUILE_ISELECT */
int
scm_internal_select (int nfds,
SELECT_TYPE *readfds,
@ -632,11 +630,6 @@ scm_internal_select (int nfds,
SELECT_TYPE *exceptfds,
struct timeval *timeout)
{
#ifndef GUILE_ISELECT
int res = select (nfds, readfds, writefds, exceptfds, timeout);
SCM_ASYNC_TICK;
return res;
#else /* GUILE_ISELECT */
struct timeval now;
coop_t *t, *curr = coop_global_curr;
@ -691,9 +684,32 @@ scm_internal_select (int nfds,
SCM_ALLOW_INTS;
SCM_ASYNC_TICK;
return coop_global_curr->retval;
#endif /* GUILE_ISELECT */
}
#else
#ifdef USE_NULL_THREADS
int
scm_internal_select (int nfds,
SELECT_TYPE *readfds,
SELECT_TYPE *writefds,
SELECT_TYPE *exceptfds,
struct timeval *timeout)
{
int res = select (nfds, readfds, writefds, exceptfds, timeout);
SCM_ASYNC_TICK;
return res;
}
void
scm_init_iselect ()
{
#include "libguile/iselect.x"
}
#endif /* USE_NULL_THREADS */
#endif /* !USE_COOP_THREADS */
/*
Local Variables:
c-file-style: "gnu"

View file

@ -3,7 +3,7 @@
#ifndef SCM_ISELECT_H
#define SCM_ISELECT_H
/* Copyright (C) 1997,1998,2000,2001 Free Software Foundation, Inc.
/* Copyright (C) 1997,1998,2000,2001, 2002 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -95,14 +95,15 @@ SCM_API int scm_internal_select (int fds,
SELECT_TYPE *efds,
struct timeval *timeout);
#ifdef GUILE_ISELECT
#ifdef USE_COOP_THREADS
SCM_API int scm_I_am_dead;
SCM_API void scm_error_revive_threads (void);
SCM_API void scm_init_iselect (void);
#endif /* GUILE_ISELECT */
#endif /* USE_COOP_THREADS */
SCM_API void scm_init_iselect (void);
#endif /* SCM_ISELECT_H */