make sure interrupts are enabled again after having been disabled

This is important to prevent race conditions. If interrupts are
    left disabled, the environment may be wrongly write protected by
    an interrupting thread and completely harmless writes in the
    environment can lead to segmentation faults.
This commit is contained in:
Marius Gerbershagen 2018-01-14 20:26:15 +01:00
parent 6316012408
commit ba8b85fc22
2 changed files with 2 additions and 1 deletions

View file

@ -358,6 +358,7 @@ ecl_wakeup_waiters(cl_env_ptr the_env, cl_object q, int flags)
}
}
ecl_giveup_spinlock(&q->queue.spinlock);
ecl_enable_interrupts_env(the_env);
ecl_process_yield();
}

View file

@ -834,8 +834,8 @@ list_directory(cl_object base_dir, cl_object text_mask, cl_object pathname_mask,
# endif /* !ECL_MS_WINDOWS_HOST */
#endif /* !HAVE_DIRENT_H */
ecl_enable_interrupts();
OUTPUT:
ecl_enable_interrupts();
return cl_nreverse(out);
}