Commit 0ab85fc9 authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

conditions: add an ext:timeout serious condition

parent e7355ac1
......@@ -386,6 +386,12 @@ FEprint_not_readable(cl_object x)
cl_error(3, @'print-not-readable', @':object', x);
}
void
FEtimeout()
{
cl_error(1, @'ext::timeout');
}
/*************
* Shortcuts *
*************/
......
......@@ -1562,7 +1562,7 @@ cl_symbols[] = {
{SYS_ "ROOM-REPORT", SI_ORDINARY, si_room_report, -1, OBJNULL},
{SYS_ "RESET-GC-COUNT", SI_ORDINARY, si_reset_gc_count, -1, OBJNULL},
#endif /* !GBC_BOEHM */
{EXT_ "TIMEOUT", EXT_ORDINARY, NULL, -1, OBJNULL},
/* #ifdef ECL_THREADS */
{MP_ "PROCESS", MP_ORDINARY, NULL, -1, OBJNULL},
{MP_ "LOCK", MP_ORDINARY, NULL, -1, OBJNULL},
......
......@@ -1562,7 +1562,7 @@ cl_symbols[] = {
{SYS_ "ROOM-REPORT","si_room_report",-1},
{SYS_ "RESET-GC-COUNT","si_reset_gc_count",-1},
#endif /* !GBC_BOEHM */
{EXT_ "TIMEOUT",NULL,-1},
/* #ifdef ECL_THREADS */
{MP_ "PROCESS",NULL,-1},
{MP_ "LOCK",NULL,-1},
......
......@@ -541,6 +541,14 @@ memory limits before executing the program again."))
()
(:REPORT "Illegal instruction."))
(define-condition ext:timeout (serious-condition)
((value :initarg :value :initform nil))
(:report (lambda (condition stream)
(format stream "Timeout occurred~@[ after ~A second~:P~]."
(slot-value condition 'value))))
(:documentation
"Signaled when an operation does not complete within an allotted time budget."))
(define-condition ext:unix-signal-received ()
((code :type fixnum
:initform 0
......
......@@ -594,6 +594,7 @@ extern ECL_API void FEundefined_function(cl_object fname) ecl_attr_noreturn;
extern ECL_API void FEinvalid_function(cl_object obj) ecl_attr_noreturn;
extern ECL_API void FEinvalid_function_name(cl_object obj) ecl_attr_noreturn;
extern ECL_API void FEprint_not_readable(cl_object obj) ecl_attr_noreturn;
extern ECL_API void FEtimeout() ecl_attr_noreturn;
extern ECL_API cl_object CEerror(cl_object c, const char *err_str, int narg, ...);
extern ECL_API void FElibc_error(const char *msg, int narg, ...) ecl_attr_noreturn;
#if defined(ECL_MS_WINDOWS_HOST) || defined(cygwin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment