1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

* async.c (s_scm_system_async_mark_for_thread): Only call

scm_i_thread_root when USE_THREADS is defined.  Use scm_root
otherwise.

* scmsigs.c (take_signal): Only call scm_i_thread_root when
USE_THREADS is defined.  Use scm_root otherwise.
(scm_sigaction_for_thread): Ignore THREAD argument when
USE_THREADS is not defined.  Also, move THREAD argument defaulting
out of HAVE_SIGACTION section, which was a bug.
This commit is contained in:
Marius Vollmer 2002-10-11 13:02:50 +00:00
parent 6d16b1257f
commit 4feac0b904
2 changed files with 15 additions and 0 deletions

View file

@ -229,10 +229,14 @@ SCM_DEFINE (scm_system_async_mark_for_thread, "system-async-mark", 1, 1, 0,
"use the current thread.") "use the current thread.")
#define FUNC_NAME s_scm_system_async_mark_for_thread #define FUNC_NAME s_scm_system_async_mark_for_thread
{ {
#ifdef USE_THREADS
scm_i_queue_async_cell (scm_cons (proc, SCM_BOOL_F), scm_i_queue_async_cell (scm_cons (proc, SCM_BOOL_F),
(SCM_UNBNDP (thread) (SCM_UNBNDP (thread)
? scm_root ? scm_root
: scm_i_thread_root (thread))); : scm_i_thread_root (thread)));
#else
scm_i_queue_async_cell (scm_cons (proc, SCM_BOOL_F), scm_root);
#endif
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -129,9 +129,14 @@ take_signal (int signum)
{ {
if (signum >= 0 && signum < NSIG) if (signum >= 0 && signum < NSIG)
{ {
#ifdef USE_THREADS
SCM thread = SCM_VECTOR_REF (signal_handler_threads, signum); SCM thread = SCM_VECTOR_REF (signal_handler_threads, signum);
scm_i_queue_async_cell (SCM_VECTOR_REF(signal_handler_cells, signum), scm_i_queue_async_cell (SCM_VECTOR_REF(signal_handler_cells, signum),
scm_i_thread_root (thread)); scm_i_thread_root (thread));
#else
scm_i_queue_async_cell (SCM_VECTOR_REF(signal_handler_cells, signum),
scm_root);
#endif
} }
#ifndef HAVE_SIGACTION #ifndef HAVE_SIGACTION
signal (signum, take_signal); signal (signum, take_signal);
@ -213,11 +218,17 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
action.sa_flags |= SCM_INUM (flags); action.sa_flags |= SCM_INUM (flags);
} }
sigemptyset (&action.sa_mask); sigemptyset (&action.sa_mask);
#endif
#ifdef USE_THREAD
if (SCM_UNBNDP (thread)) if (SCM_UNBNDP (thread))
thread = scm_current_thread (); thread = scm_current_thread ();
else else
SCM_VALIDATE_THREAD (4, thread); SCM_VALIDATE_THREAD (4, thread);
#else
thread = SCM_BOOL_F;
#endif #endif
SCM_DEFER_INTS; SCM_DEFER_INTS;
old_handler = SCM_VECTOR_REF(*signal_handlers, csig); old_handler = SCM_VECTOR_REF(*signal_handlers, csig);
if (SCM_UNBNDP (handler)) if (SCM_UNBNDP (handler))