mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +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:
parent
b1e945d7ec
commit
1d0bde44b7
2 changed files with 31 additions and 14 deletions
|
@ -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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
#include "libguile/iselect.h"
|
#include "libguile/iselect.h"
|
||||||
|
|
||||||
#ifdef GUILE_ISELECT
|
#ifdef USE_COOP_THREADS
|
||||||
|
|
||||||
#include "libguile/coop-threads.h"
|
#include "libguile/coop-threads.h"
|
||||||
|
|
||||||
|
@ -623,8 +623,6 @@ scm_init_iselect ()
|
||||||
#include "libguile/iselect.x"
|
#include "libguile/iselect.x"
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GUILE_ISELECT */
|
|
||||||
|
|
||||||
int
|
int
|
||||||
scm_internal_select (int nfds,
|
scm_internal_select (int nfds,
|
||||||
SELECT_TYPE *readfds,
|
SELECT_TYPE *readfds,
|
||||||
|
@ -632,11 +630,6 @@ scm_internal_select (int nfds,
|
||||||
SELECT_TYPE *exceptfds,
|
SELECT_TYPE *exceptfds,
|
||||||
struct timeval *timeout)
|
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;
|
struct timeval now;
|
||||||
coop_t *t, *curr = coop_global_curr;
|
coop_t *t, *curr = coop_global_curr;
|
||||||
|
|
||||||
|
@ -691,9 +684,32 @@ scm_internal_select (int nfds,
|
||||||
SCM_ALLOW_INTS;
|
SCM_ALLOW_INTS;
|
||||||
SCM_ASYNC_TICK;
|
SCM_ASYNC_TICK;
|
||||||
return coop_global_curr->retval;
|
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:
|
Local Variables:
|
||||||
c-file-style: "gnu"
|
c-file-style: "gnu"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef SCM_ISELECT_H
|
#ifndef SCM_ISELECT_H
|
||||||
#define 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
|
* 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
|
* 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,
|
SELECT_TYPE *efds,
|
||||||
struct timeval *timeout);
|
struct timeval *timeout);
|
||||||
|
|
||||||
#ifdef GUILE_ISELECT
|
#ifdef USE_COOP_THREADS
|
||||||
|
|
||||||
SCM_API int scm_I_am_dead;
|
SCM_API int scm_I_am_dead;
|
||||||
|
|
||||||
SCM_API void scm_error_revive_threads (void);
|
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 */
|
#endif /* SCM_ISELECT_H */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue