ECL_BUILTIN_FOREIGN_DATA,
ECL_BUILTIN_FRAME,
ECL_BUILTIN_WEAK_POINTER
+#ifdef ECL_LWP
+ ,
+ ECL_BUILTIN_CONTINUATION,
+ ECL_BUILTIN_THREAD
+#endif
#ifdef ECL_THREADS
,
ECL_BUILTIN_PROCESS,
case t_cfunfixed:
case t_cclosure:
index = ECL_BUILTIN_FUNCTION; break;
+#ifdef ECL_LWP /* XXX */
+ case t_cont:
+ index = ECL_BUILTIN_CONTINUATION; break;
+ case t_thread:
+ index = ECL_BUILTIN_THREAD; break;
+#endif
#ifdef ECL_THREADS
case t_process:
index = ECL_BUILTIN_PROCESS; break;
_ecl_write_unreadable(x, "weak-pointer", ECL_NIL, stream);
}
+#ifdef ECL_LWP
+static void
+write_cont(cl_object x, cl_object stream)
+{
+ _ecl_write_unreadable(x, "continuation", ECL_NIL, stream);
+}
+
+static void
+write_thread(cl_object x, cl_object stream)
+{
+ _ecl_write_unreadable(x, "thread", ECL_NIL, stream);
+}
+#endif
+
#ifdef ECL_THREADS
static void
write_process(cl_object x, cl_object stream)
write_cfun, /* t_cfunfixed */
write_cclosure, /* t_cclosure */
write_instance, /* t_instance */
+ write_cont, /* t_cont */
+ write_thread, /* t_thread */
#ifdef ECL_THREADS
write_process, /* t_process */
write_lock, /* t_lock */
#endif /* !GBC_BOEHM */
#ifdef ECL_LWP
+{EXT_ "CONT", EXT_ORDINARY, NULL, -1, OBJNULL},
+{EXT_ "THREAD", EXT_ORDINARY, NULL, -1, OBJNULL},
+
{EXT_ "MAKE-THREAD", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "DEACTIVATE", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "REACTIVATE", EXT_ORDINARY, NULL, -1, OBJNULL},
#endif /* !GBC_BOEHM */
#ifdef ECL_LWP
+{EXT_ "CONT",NULL},
+{EXT_ "THREAD",NULL},
+
{EXT_ "MAKE-THREAD",NULL},
{EXT_ "DEACTIVATE",NULL},
{EXT_ "REACTIVATE",NULL},
case t_cfunfixed:
case t_cclosure:
return @'compiled-function';
+#ifdef ECL_LWP
+ case t_cont:
+ return @'ext::cont';
+ case t_thread:
+ return @'ext::thread';
+#endif
#ifdef ECL_THREADS
case t_process:
return @'mp::process';
t_cclosure,
t_instance,
t_structure = t_instance,
+#ifdef ECL_LWP
+ t_cont,
+ t_thread,
+#endif
#ifdef ECL_THREADS
t_process,
t_lock,
_ECL_HDR;
};
+#ifdef ECL_LWP
+struct ecl_cont {
+ _ECL_HDR2(resumed, timed_out);
+ cl_object thread;
+};
+
+struct ecl_thread {
+ _ECL_HDR;
+ cl_object cont; /* its continuation */
+};
+#endif /* ECL_LWP */
+
#ifdef ECL_THREADS
enum {
ECL_PROCESS_INACTIVE = 0,
struct ecl_cclosure cclosure; /* compiled closure */
struct ecl_dummy d; /* dummy */
struct ecl_instance instance; /* clos instance */
+#ifdef ECL_LWP
+ struct ecl_cont cont; /* continuation */
+ struct ecl_thread thread; /* thread */
+#endif
#ifdef ECL_THREADS
struct ecl_process process; /* process */
struct ecl_queue queue; /* queue */