ecl_check_pending_interrupts() now takes the environment as argument

To wake up a process we need not supply any function (it is faster as it saves a call to queue_signal()
This commit is contained in:
Juan Jose Garcia Ripoll 2012-03-20 00:00:59 +01:00
parent b10c0c1acf
commit d54cbaa749
3 changed files with 5 additions and 5 deletions

View file

@ -166,7 +166,7 @@ ecl_wait_on(cl_object (*condition)(cl_env_ptr, cl_object), cl_object o)
ecl_atomic_queue_push(o->lock.waiter, own_process);
own_process->process.waiting_for = o;
ecl_bds_bind(the_env, @'ext::*interrupts-enabled*', Ct);
ecl_check_pending_interrupts();
ecl_check_pending_interrupts(the_env);
do {
ecl_musleep(waiting_time(iteration++, &start), 1);
} while (condition(the_env, o) == Cnil);
@ -183,7 +183,7 @@ wakeup_this(cl_object p, int flags)
{
if (flags & ECL_WAKEUP_RESET_FLAG)
p->process.waiting_for = Cnil;
mp_interrupt_process(p, @'+');
mp_interrupt_process(p, Cnil);
}
static void

View file

@ -735,7 +735,7 @@ make_windows_handle(HANDLE h)
set_external_process_pid(process, pid);
} ECL_WITH_LOCK_END;
ecl_bds_unwind1(the_env);
ecl_check_pending_interrupts();
ecl_check_pending_interrupts(the_env);
close(child_stdin);
close(child_stdout);
close(child_stderr);

View file

@ -1834,7 +1834,7 @@ extern ECL_API cl_object si_copy_file(cl_object orig, cl_object end);
#define ecl_enable_interrupts_env(env) ((env)->disable_interrupts=0)
#else
#define ecl_disable_interrupts_env(env) ((env)->disable_interrupts=1)
#define ecl_enable_interrupts_env(env) (((env)->disable_interrupts^=1) && (ecl_check_pending_interrupts(),0))
#define ecl_enable_interrupts_env(env) (((env)->disable_interrupts^=1) && (ecl_check_pending_interrupts(env),0))
#endif
#define ecl_clear_interrupts_env(env) ((env)->pendinginterrupts=0)
#define ecl_clear_interrupts() ecl_clear_interrupts(&cl_env)
@ -1851,7 +1851,7 @@ extern ECL_API cl_object si_trap_fpe(cl_object condition, cl_object flag);
#if defined(ECL_MS_WINDOWS_HOST)
extern ECL_API LONG WINAPI _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS*);
#endif
extern ECL_API void ecl_check_pending_interrupts(void);
extern ECL_API void ecl_check_pending_interrupts(cl_env_ptr env);
/* unixsys.c */