Skip to content
Snippets Groups Projects
Commit 798ec63b authored by dtc's avatar dtc
Browse files

Add the function set_maybe_gc_pending for the x86 port; called by the

GC when it reaches its trigger within pseudo atomic so that maybe_gc
is called at the end of pseudo atomic.
parent e2aa1c4f
No related branches found
No related tags found
No related merge requests found
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.9 1997/03/16 15:59:41 pw Exp $ */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.10 1997/11/19 02:41:54 dtc Exp $ */
/* Interrupt handing magic. */
......@@ -349,13 +349,9 @@ static boolean gc_trigger_hit(HANDLER_ARGS)
}
#endif
#ifndef i386
boolean interrupt_maybe_gc(HANDLER_ARGS)
{
#ifdef __linux__
GET_CONTEXT
#endif
if (!foreign_function_call_active
#ifndef INTERNAL_GC_TRIGGER
&& gc_trigger_hit(signal, code, context)
......@@ -388,6 +384,26 @@ boolean interrupt_maybe_gc(HANDLER_ARGS)
}else
return FALSE;
}
#endif
#ifdef i386
void set_maybe_gc_pending(void)
{
maybe_gc_pending = TRUE;
if (pending_signal == 0) {
/* Block all blockable signals */
#ifdef POSIX_SIGS
sigset_t block;
sigemptyset(&block);
FILLBLOCKSET(&block);
sigprocmask(SIG_BLOCK, &block, &pending_mask);
#else
pending_mask = sigblock(BLOCKABLE);
#endif
}
SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(1));
}
#endif
/****************************************************************\
* Noise to install handlers. *
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.h,v 1.4 1994/10/24 20:06:00 ram Exp $ */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.h,v 1.5 1997/11/19 02:41:55 dtc Exp $ */
#if !defined(_INCLUDE_INTERRUPT_H_)
#define _INCLUDE_INTERRUPT_H_
......@@ -14,6 +14,10 @@ union interrupt_handler {
void (*c)(HANDLER_ARGS);
};
#ifdef i386
extern void set_maybe_gc_pending(void);
#endif
extern void interrupt_init(void);
extern void fake_foreign_function_call(struct sigcontext *context);
extern void undo_fake_foreign_function_call(struct sigcontext *context);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment