Commit f596d2ba authored by Erick Gallesio's avatar Erick Gallesio

Minor modifications

parent 90bf8c23
This diff is collapsed.
......@@ -2,7 +2,7 @@ dnl configure.in for STklos
dnl
dnl Author: Erick Gallesio [eg@unice.fr]
dnl Creation date: 28-Dec-1999 21:19 (eg)
dnl Last file update: 13-Apr-2006 13:25 (eg)
dnl Last file update: 15-Apr-2006 00:07 (eg)
AC_INIT(src/stklos.c)
......@@ -77,7 +77,7 @@ dnl Now look at what threads we want
case "$THREADS" in
no | none | single)
THREADS=none
CALLCC_STK=callcc.stk
CALLCC_STK='"callcc.stk"'
AC_DEFINE(THREADS_NONE, [], [No thread support])
;;
posix | pthreads)
......@@ -85,7 +85,7 @@ case "$THREADS" in
AC_CHECK_LIB(pthread, pthread_create, LIBS="-lpthread $LIBS",
[AC_MSG_ERROR([Missing PThread library])])
THREADS=pthreads
CALLCC_STK=callcc.stk
CALLCC_STK='"callcc.stk"'
AC_DEFINE(THREADS_PTHREADS, [], [PThread support])
;;
lurc)
......@@ -100,7 +100,7 @@ case "$THREADS" in
[AC_MSG_ERROR([Missing GC support in LURC])])
dnl That should be good
AC_DEFINE(THREADS_LURC, [], [LURC threads support])
CALLCC_STK=dyn-wind-lurc.stk
CALLCC_STK='"dyn-wind-lurc.stk"'
;;
*)
AC_MSG_ERROR([Unknown thread system: $THREADS])
......
......@@ -155,7 +155,7 @@ NROFF = nroff
MANS = $(man_MANS)
DATA = $(dochtml_DATA) $(docimg_DATA) $(docpdf_DATA) $(scheme_DATA)
DIST_COMMON = Makefile.am Makefile.in stklos-compile.1.in \
DIST_COMMON = Makefile.am Makefile.in TODO stklos-compile.1.in \
stklos-config.1.in stklos-genlex.1.in stklos-install.1.in \
stklos.1.in
all: all-am
......
......@@ -153,7 +153,7 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES =
DATA = $(scheme_DATA)
DIST_COMMON = README Makefile.am Makefile.in extconf.h.in
DIST_COMMON = README Makefile.am Makefile.in TODO extconf.h.in
all: all-am
.SUFFIXES:
......
......@@ -2,14 +2,14 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 18-Jul-2000 10:30 (eg)
# Last file update: 13-Sep-2005 22:45 (eg)
# Last file update: 14-Apr-2006 19:20 (eg)
CC = @CC@
CFLAGS = @CFLAGS@
STKCONF = ../utils/stklos-config
INCLUDES = -I../src $(COMPFLAGS) @GCINC@
INCLUDES = -I../src @GCINC@ $(COMPFLAGS)
COMPILE = @CC@ @CFLAGS@ @SH_COMP_FLAGS@ @GTK_CONFIG_CFLAGS@ $(INCLUDES)
shobjectdir=$(prefix)/lib/@PACKAGE@/@VERSION@
......
......@@ -18,7 +18,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 18-Jul-2000 10:30 (eg)
# Last file update: 13-Sep-2005 22:45 (eg)
# Last file update: 14-Apr-2006 19:20 (eg)
SHELL = @SHELL@
srcdir = @srcdir@
......@@ -125,7 +125,7 @@ install_sh = @install_sh@
CFLAGS = @CFLAGS@
STKCONF = ../utils/stklos-config
INCLUDES = -I../src $(COMPFLAGS) @GCINC@
INCLUDES = -I../src @GCINC@ $(COMPFLAGS)
COMPILE = @CC@ @CFLAGS@ @SH_COMP_FLAGS@ @GTK_CONFIG_CFLAGS@ $(INCLUDES)
shobjectdir = $(prefix)/lib/@PACKAGE@/@VERSION@
......@@ -186,7 +186,7 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libgtklos_a_SOURCES)
DATA = $(scheme_DATA)
DIST_COMMON = Makefile.am Makefile.in gtklosconf.h.in
DIST_COMMON = Makefile.am Makefile.in TODO gtklosconf.h.in
SOURCES = $(libgtklos_a_SOURCES)
all: all-am
......
......@@ -2,7 +2,7 @@
#
# Author: Stephane Epardaud [Stephane.Epardaud@inria.fr]
# Creation date: 3-Apr-2006 10:30 (se)
# Last file update: 13-Apr-2006 17:31 (eg)
# Last file update: 14-Apr-2006 19:22 (eg)
CC = @CC@
......@@ -31,7 +31,7 @@ stklurc.@SH_SUFFIX@: libstklurc.a
chmod 0755 stklurc.@SH_SUFFIX@
lurc.ostk: $(scheme_files)
../../utils/tmpcomp lurc.stk lurc.ostk ../..
../../utils/tmpcomp lurc.stk lurc.ostk
clean:
/bin/rm -f *.o *.ostk *.@SH_SUFFIX@ *.a *~
......
......@@ -18,7 +18,7 @@
#
# Author: Stephane Epardaud [Stephane.Epardaud@inria.fr]
# Creation date: 3-Apr-2006 10:30 (se)
# Last file update: 13-Apr-2006 17:31 (eg)
# Last file update: 14-Apr-2006 19:22 (eg)
SHELL = @SHELL@
srcdir = @srcdir@
......@@ -118,6 +118,7 @@ STACK_DIRECTION = @STACK_DIRECTION@
STRIP = @STRIP@
SVN_URL = @SVN_URL@
THREADS = @THREADS@
THREAD_FILES = @THREAD_FILES@
VERSION = @VERSION@
am__include = @am__include@
am__quote = @am__quote@
......@@ -400,7 +401,7 @@ stklurc.@SH_SUFFIX@: libstklurc.a
chmod 0755 stklurc.@SH_SUFFIX@
lurc.ostk: $(scheme_files)
../../utils/tmpcomp lurc.stk lurc.ostk ../..
../../utils/tmpcomp lurc.stk lurc.ostk
clean:
/bin/rm -f *.o *.ostk *.@SH_SUFFIX@ *.a *~
......
......@@ -21,13 +21,13 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 01-Jan-2000 15:04 (eg)
;;;; Last file update: 13-Apr-2006 17:55 (eg)
;;;; Last file update: 14-Apr-2006 23:34 (eg)
;;;;
(include "runtime.stk") ; Definition necessary for the bootstrap
(include "module.stk") ; All the macros for defining modules
(include "@CALLCC_STK@") ; Call/cc support
(include "r5rs.stk") ; R5RS stuff written in Scheme
(include @CALLCC_STK@) ; Call/cc support
(include "struct.stk") ; STklos structures
(include "bonus.stk") ; Extended functions and syntaxes
(include "load.stk") ; Extended load dealing with paths and suffixes
......
;;;;
;;;; callcc.stk -- R5RS call/cc function written in Scheme
;;;;
;;;; Copyright © 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright © 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 3-Apr-2006 12:27 (eg)
;;;; Last file update: 3-Apr-2006 12:27 (eg)
;;;; Last file update: 14-Apr-2006 19:53 (eg)
;;;;
(define (%call/cc proc)
......
;;;;
;;;; dyn-wind-lurc.stk -- R5RS dynamic-wind function written in Scheme
;;;;
;;;; Copyright © 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright © 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 3-Apr-2006 12:27 (eg)
;;;; Last file update: 3-Apr-2006 12:27 (eg)
;;;; Last file update: 14-Apr-2006 19:55 (eg)
;;;;
(define (dynamic-wind before during after)
......
;;;;
;;;; r5rs.stk -- R5RS function written in Scheme
;;;;
;;;; Copyright © 2000-2005 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright © 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 14-Jun-2000 12:27 (eg)
;;;; Last file update: 4-Aug-2005 11:50 (eg)
;;;; Last file update: 14-Apr-2006 19:54 (eg)
;;;;
......@@ -838,6 +838,13 @@ doc>
doc>
|#
;;; ********** N O T E **********
;;; Implementation of call/cc and dynamic-wind is in file callcc.stk
;;; if the thread system is not LURC. Otherwise, the implementation is
;;; in file called dyn-wind-lurc.stk
;;;
#|
<doc with-input-from-file with-output-to-file
* (with-input-from-file string thunk)
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 26-Jan-2006 22:56 (eg)
;;;; Last file update: 6-Feb-2006 13:32 (eg)
;;;; Last file update: 14-Apr-2006 20:00 (eg)
;;;;
(define (%thread-timeout->seconds timeout)
(cond
......@@ -34,8 +34,6 @@
(define (make-thread thunk :optional (name (symbol->string (gensym "thread"))))
(define (thread-handler c)
; (DEBUG "Erreur dans une thread. Type de cond ~S" c)
; (describe c)
(%thread-end-exception-set! (current-thread) c)
c)
(%make-thread (lambda ()
......
......@@ -243,7 +243,8 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(stklos_SOURCES)
DATA = $(extrainc_DATA)
DIST_COMMON = Makefile.am Makefile.in extraconf.h.in stklosconf.h.in
DIST_COMMON = Makefile.am Makefile.in TODO extraconf.h.in \
stklosconf.h.in
SOURCES = $(stklos_SOURCES)
all: stklosconf.h
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 5-Jan-2000 12:17 (eg)
* Last file update: 6-Apr-2006 12:52 (eg)
* Last file update: 14-Apr-2006 20:10 (eg)
*/
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 22:58 (eg)
* Last file update: 12-Apr-2006 16:00 (eg)
* Last file update: 14-Apr-2006 20:17 (eg)
*/
#ifndef STKLOS_H
......@@ -1161,11 +1161,10 @@ int STk_init_vm();
#ifdef THREADS_LURC
typedef int (*STk_main_t)(int, char**);
int STk_thread_main(STk_main_t themain, int argc, char **argv);
#endif /* ! THREADS_LURC */
SCM *STk_save_vm(void);
void STk_restore_vm(SCM *sp);
#endif /* ! THREADS_LURC */
/*****************************************************************************/
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 23-Jan-2006 12:14 (eg)
* Last file update: 13-Apr-2006 15:51 (eg)
* Last file update: 14-Apr-2006 20:28 (eg)
*/
......@@ -34,7 +34,6 @@
#include "thread.h"
SCM STk_primordial_thread = NULL;
static SCM primordial;
static SCM cond_thread_terminated, cond_join_timeout, cond_thread_abandonned_mutex;
static SCM all_threads = STk_nil;
......@@ -78,10 +77,6 @@ static void terminate_scheme_thread(void *arg)
{
SCM thr = (SCM) arg;
#ifdef STK_DEBUG
STk_debug("Cleaning thread thr");
#endif
pthread_mutex_lock(&THREAD_MYMUTEX(thr));
THREAD_STATE(thr) = th_terminated;
......@@ -303,28 +298,16 @@ DEFINE_PRIMITIVE("%thread-join!", thread_join, subr2, (SCM thr, SCM tm))
pthread_mutex_lock(&THREAD_MYMUTEX(thr));
while (THREAD_STATE(thr) != th_terminated) {
#ifdef STK_DEBUG
STk_debug("thread-join loop state=%d", THREAD_STATE(thr));
#endif
if (tm != STk_false) {
int n = pthread_cond_timedwait(&THREAD_MYCONDV(thr),
&THREAD_MYMUTEX(thr),
&ts);
if (n == ETIMEDOUT) {
#ifdef STK_DEBUG
STk_debug("TIMEOUT");
#endif
res = STk_true;
break;
}
if (n == ETIMEDOUT) { res = STk_true; break; }
}
else
pthread_cond_wait(&THREAD_MYCONDV(thr), &THREAD_MYMUTEX(thr));
}
pthread_mutex_unlock(&THREAD_MYMUTEX(thr));
#ifdef STK_DEBUG
STk_debug("Fin de l'attente");
#endif
return res;
}
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 1-Mar-2000 19:51 (eg)
* Last file update: 6-Apr-2006 19:16 (eg)
* Last file update: 14-Apr-2006 20:33 (eg)
*/
// INLINER values
......@@ -35,7 +35,6 @@
#include "vm.h"
#include "vm-instr.h"
#include "struct.h"
#ifdef THREADS_LURC
# include <lurc.h>
#endif
......@@ -437,9 +436,7 @@ DEFINE_PRIMITIVE("apply", scheme_apply, apply, (void))
/* This function is never called. It is just here to declare the primitive
* apply, as a primitive of type tc_apply
*/
#ifdef STK_DEBUG
STk_debug("CALL apply");
#endif
STk_panic("Inside apply. Should not occur");
return STk_void;
}
......@@ -1763,7 +1760,7 @@ int STk_boot_from_C(void)
system_has_booted = 1;
return 0;
}
#ifdef THREADS_LURC
SCM *STk_save_vm(void){
vm_thread_t *vm = STk_get_current_vm();
......@@ -1779,6 +1776,7 @@ void STk_restore_vm(SCM *sp){
FULL_RESTORE_VM_STATE(vm->sp);
UNSAVE_HANDLER_STATE();
}
#endif
int STk_init_vm()
{
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 3-May-2005 12:28 (eg)
;;;; Last file update: 20-Jan-2006 10:48 (eg)
;;;; Last file update: 14-Apr-2006 20:34 (eg)
;;;;
(load "./test.stk")
......@@ -30,7 +30,7 @@
(load "test-number.stk")
(load "test-keyword.stk")
(unless (eq? (%thread-system) 'lurc)
(load "test-callcc.stk"))
(load "test-callcc.stk"))
(load "test-sport.stk")
(load "test-fport.stk")
(load "test-srfi.stk")
......
......@@ -2,7 +2,7 @@
#
# tmpcomp -- A temporary script to bootstrap the system
#
# Copyright © 2002-2005 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
# Copyright © 2002-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
#
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,30 +22,35 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 1-Jan-2002 18:57 (eg)
# Last file update: 29-Mar-2005 19:02 (eg)
# Last file update: 14-Apr-2006 23:30 (eg)
#
# This script is only used to compile the different components of the
# system which need compilation. It will not be installed since the
# user version is the stklos-compile script.
if [ $# != 2 -a $# != 3 ] ;then
echo "Usage: $0 src bytecode-file [depth]"
if [ $# != 2 ] ;then
echo "Usage: $0 src bytecode-file "
exit 1
fi
in=$1
out=$2
depth=${3:-..}
# Sep is now also ":" on CYGWIN
sep=":"
STKLOS_LOAD_PATH="$depth/lib${sep}$depth/gtklos"
if test -f ../src/boot.img ;then
prefix=".."
else
prefix="../.."
fi
STKLOS_LOAD_PATH="${prefix}/lib${sep}${prefix}/gtklos"
export STKLOS_LOAD_PATH
$depth/src/stklos -c -q -b $depth/src/boot.img \
-f $depth/utils/stklos-compile -- \
${prefix}/src/stklos -c -q -b ${prefix}/src/boot.img \
-f ${prefix}/utils/stklos-compile -- \
--no-time --output=$out $in && chmod a+x $out
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