Commit e8315019 authored by Erick Gallesio's avatar Erick Gallesio

.

parent 506ab775
2006-10-27 Erick Gallesio <eg@essi.fr>
* Changed the GC to version 7.0alpha7
* Deleted the --disable-pthreads option for MacOS X
2006-10-25 Erick Gallesio <eg@essi.fr>
* lib/srfi-0.stk: Fully srfi-18 compliant.
......
......@@ -13,7 +13,7 @@ instead of the one provided in.
GC: The Boehm's conservative garbage collector for C and C++
============================================================
- Version: 6.1
- Version: 7.0alpha7
- License: Free (BSD-like)
- Home Page: http://www.hpl.hp.com/personal/Hans_Boehm/gc
......
......@@ -2,7 +2,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 5-Sep-2006 11:42 (eg)
# Last file update: 27-Oct-2006 14:50 (eg)
CC = @CC@
CFLAGS = @CFLAGS@ @STKCFLAGS@
......
......@@ -18,7 +18,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 5-Sep-2006 11:42 (eg)
# Last file update: 27-Oct-2006 14:50 (eg)
srcdir = @srcdir@
......
/*
This file was automatically generated on Fri Oct 27 11:22:56 2006 by make-C-boot
This file was automatically generated on Fri Oct 27 15:02:12 2006 by make-C-boot
This is a dump of the image in file /mnt/users/eg/Projects/STklos/lib/boot.img3
***DO NOT EDIT BY HAND***
*/
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 22:58 (eg)
* Last file update: 20-Oct-2006 20:40 (eg)
* Last file update: 27-Oct-2006 12:37 (eg)
*/
#ifndef STKLOS_H
......@@ -273,6 +273,15 @@ struct primitive_obj {
#define THE_PRIMITIVE(_name) ((SCM) CPP_CONCAT(&STk_o_, _name))
/*
------------------------------------------------------------------------------
----
---- B A S E 6 4 . C
----
------------------------------------------------------------------------------
*/
int STk_init_base64(void);
/*
------------------------------------------------------------------------------
......@@ -1109,6 +1118,8 @@ EXTERN_PRIMITIVE("exit", exit, subr01, (SCM retcode));
------------------------------------------------------------------------------
*/
EXTERN_PRIMITIVE("current-thread", current_thread, subr0, (void));
int STk_init_threads(int stack_size, void *start_stack);
int STk_init_mutexes(void);
/*
------------------------------------------------------------------------------
......
/*
* thread-common.c -- Threads support in STklos
*
* Copyright © 2006 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
* Copyright 2006 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 23-Jan-2006 12:14 (eg)
* Last file update: 25-Oct-2006 10:19 (eg)
* Last file update: 27-Oct-2006 14:49 (eg)
*/
#include <unistd.h>
#include "stklos.h"
......@@ -33,6 +33,7 @@ SCM STk_primordial_thread = NULL;
SCM STk_cond_thread_terminated;
static SCM cond_thread_abandonned_mutex, cond_join_timeout;
void STk_error_bad_thread(SCM obj)
{
STk_error("bad thread ~S", obj);
......@@ -63,7 +64,6 @@ struct timeval STk_thread_abstime_to_reltime(double abs_secs)
return rel;
}
/* ====================================================================== */
/*
<doc EXT current-thread
......@@ -81,6 +81,25 @@ DEFINE_PRIMITIVE("current-thread", current_thread, subr0, (void))
return vm->scheme_thread;
}
DEFINE_PRIMITIVE("%thread-dynwind-stack", thread_dynwind_stack, subr0, (void))
{
vm_thread_t *vm = STk_get_current_vm();
return vm->dynwind_stack;
}
DEFINE_PRIMITIVE("%thread-dynwind-stack-set!", thread_dynwind_stack_set, subr1,
(SCM value))
{
vm_thread_t *vm = STk_get_current_vm();
vm->dynwind_stack = value;
return STk_void;
}
/* ====================================================================== */
static SCM do_make_thread(SCM thunk, SCM name, int stack_size)
{
SCM z;
......@@ -101,6 +120,7 @@ static SCM do_make_thread(SCM thunk, SCM name, int stack_size)
return z;
}
DEFINE_PRIMITIVE("%make-thread", make_thread, subr3,(SCM thunk, SCM name, SCM ssize))
{
SCM z;
......@@ -168,23 +188,6 @@ DEFINE_PRIMITIVE("thread-stack-size", thread_ssize, subr1, (SCM thr))
return MAKE_INT(THREAD_STACK_SIZE(thr));
}
DEFINE_PRIMITIVE("%thread-dynwind-stack", thread_dynwind_stack, subr0, (void))
{
vm_thread_t *vm = STk_get_current_vm();
return vm->dynwind_stack;
}
DEFINE_PRIMITIVE("%thread-dynwind-stack-set!", thread_dynwind_stack_set, subr1,
(SCM value))
{
vm_thread_t *vm = STk_get_current_vm();
vm->dynwind_stack = value;
return STk_void;
}
DEFINE_PRIMITIVE("%thread-end-exception", thread_end_exception, subr1, (SCM thr))
{
if (!THREADP(thr)) STk_error_bad_thread(thr);
......@@ -322,6 +325,8 @@ static struct extended_type_descr xtype_thread = {
print_thread /* print function */
};
/* ---------------------------------------------------------------------- */
int STk_init_threads(int stack_size, void *start_stack)
{
vm_thread_t *vm = STk_allocate_vm(stack_size);
......@@ -329,9 +334,9 @@ int STk_init_threads(int stack_size, void *start_stack)
/* Thread Type declaration */
DEFINE_XTYPE(thread, &xtype_thread);
/* Specific thread initialisation */
if(STk_init_sys_threads(vm) != TRUE)
if (STk_init_sys_threads(vm) != TRUE)
return FALSE;
/* Define the threads exceptions */
......@@ -358,6 +363,8 @@ int STk_init_threads(int stack_size, void *start_stack)
/* Thread primitives */
ADD_PRIMITIVE(current_thread);
ADD_PRIMITIVE(thread_dynwind_stack);
ADD_PRIMITIVE(thread_dynwind_stack_set);
ADD_PRIMITIVE(make_thread);
ADD_PRIMITIVE(threadp);
ADD_PRIMITIVE(thread_name);
......@@ -366,8 +373,6 @@ int STk_init_threads(int stack_size, void *start_stack)
ADD_PRIMITIVE(thread_end_exception_set);
ADD_PRIMITIVE(thread_end_result);
ADD_PRIMITIVE(thread_end_result_set);
ADD_PRIMITIVE(thread_dynwind_stack);
ADD_PRIMITIVE(thread_dynwind_stack_set);
ADD_PRIMITIVE(thread_specific);
ADD_PRIMITIVE(thread_specific_set);
ADD_PRIMITIVE(thread_start);
......
......@@ -21,7 +21,7 @@
*
* Author: Stephane Epardaud [stephane.epardaud@inria.fr]
* Creation date: 23-Jan-2006 12:14 (se)
* Last file update: 16-Apr-2006 11:35 (eg)
* Last file update: 27-Oct-2006 14:55 (eg)
*/
#include "thread-common.h"
......@@ -29,6 +29,9 @@
#include "vm.h"
SCM STk_primordial_thread = NULL;
SCM STk_cond_thread_terminated;
static SCM cond_thread_abandonned_mutex, cond_join_timeout;
static vm_thread_t *current_vm;
......@@ -54,17 +57,46 @@ DEFINE_PRIMITIVE("%thread-no-support", threadno, vsubr, (int argc, SCM *argv))
return STk_void;
}
DEFINE_PRIMITIVE("%thread-dynwind-stack", thread_dynwind_stack, subr0, (void))
{
vm_thread_t *vm = STk_get_current_vm();
return vm->dynwind_stack;
}
DEFINE_PRIMITIVE("%thread-dynwind-stack-set!", thread_dynwind_stack_set, subr1,
(SCM value))
{
vm_thread_t *vm = STk_get_current_vm();
vm->dynwind_stack = value;
return STk_void;
}
int STk_init_threads(int stack_size)
int STk_init_threads(int stack_size, void *start_stack)
{
/* Define the threads exceptions */
STk_cond_thread_terminated =
STk_defcond_type("&thread-terminated", STk_false,
LIST1(STk_intern("canceller")),
STk_STklos_module);
cond_thread_abandonned_mutex = STk_defcond_type("&thread-abandonned-mutex",
STk_false,
STk_nil,
STk_STklos_module);
cond_join_timeout = STk_defcond_type("&thread-join-timeout", STk_false,
STk_nil, STk_STklos_module);
/* Wrap the main thread in a thread called "primordial" */
current_vm = STk_allocate_vm(stack_size);
current_vm->scheme_thread = STk_false;
current_vm->start_stack = start_stack;
STk_primordial_thread = STk_false;
/* Thread primitives */
ADD_PRIMITIVE(current_thread);
ADD_PRIMITIVE(thread_system);
ADD_PRIMITIVE(thread_dynwind_stack);
ADD_PRIMITIVE(thread_dynwind_stack_set);
/* Fake primitives */
ADD_PRIMITIVE(threadno);
......
......@@ -21,9 +21,14 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 16-Apr-2006 12:54 (eg)
;;;; Last file update: 25-Oct-2006 17:21 (eg)
;;;; Last file update: 27-Oct-2006 15:00 (eg)
;;;;
(unless (eq? (%thread-system) 'none)
;; These tests are performed when we have real threads (lurc or pthread ones)
;;;; Most of theses tests were stolen in Gauche Scheme distribution
(require "test")
......@@ -319,3 +324,5 @@
(reverse log))))
(test-section-end)
)
\ No newline at end of file
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