/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.10 1991/06/22 19:29:05 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.11 1991/07/02 18:16:47 cph Exp $
Copyright (c) 1990-91 Massachusetts Institute of Technology
dstack_protect (restore_signal_mask, outside);
}
+static sigset_t blocked_signals;
+
+void
+DEFUN_VOID (block_signals)
+{
+ sigset_t all_signals;
+ UX_sigfillset (&all_signals);
+ UX_sigprocmask (SIG_BLOCK, (&all_signals), (&blocked_signals));
+}
+
+void
+DEFUN_VOID (unblock_signals)
+{
+ UX_sigprocmask (SIG_SETMASK, (&blocked_signals), 0);
+}
+
#else /* not HAVE_POSIX_SIGNALS */
void
{
}
+void
+DEFUN_VOID (block_signals)
+{
+}
+
+void
+DEFUN_VOID (unblock_signals)
+{
+}
+
#endif /* not HAVE_POSIX_SIGNALS */
\f
/* Signal Descriptors */
-/* Copyright (C) 1990 Free Software Foundation, Inc.
+/* Copyright (C) 1990-91 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
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/wind.c,v 1.1 1990/06/20 19:38:59 cph Rel $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/wind.c,v 1.2 1991/07/02 18:16:59 cph Exp $ */
#include <stdio.h>
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
+extern void EXFUN (block_signals, (void));
+extern void EXFUN (unblock_signals, (void));
+
static void
DEFUN (error, (procedure_name, message),
CONST char * procedure_name AND
void
DEFUN_VOID (dstack_reset)
{
+ block_signals ();
obstack_free ((&dstack), 0);
dstack_initialize ();
+ unblock_signals ();
}
#define EXPORT(sp) ((PTR) (((char *) (sp)) + (sizeof (PTR))))
PTR
DEFUN (dstack_alloc, (length), unsigned int length)
{
- PTR chunk = (obstack_alloc ((&dstack), ((sizeof (PTR)) + length)));
+ PTR chunk;
+ block_signals ();
+ chunk = (obstack_alloc ((&dstack), ((sizeof (PTR)) + length)));
(* ((PTR *) chunk)) = dstack_position;
dstack_position = chunk;
+ unblock_signals ();
return (EXPORT (chunk));
}
void
DEFUN (dstack_set_position, (position), PTR position)
{
+ block_signals ();
+#define DEBUG_DSTACK
+#ifdef DEBUG_DSTACK
+ {
+ PTR * sp = dstack_position;
+ while (sp != position)
+ {
+ if (sp == 0)
+ error ("dstack_set_position", "position argument not found");
+ sp = (*sp);
+ }
+ }
+#endif /* DEBUG_DSTACK */
while (dstack_position != position)
{
if (dstack_position == 0)
obstack_free ((&dstack), sp);
}
}
+ unblock_signals ();
}
struct binding_record