On Wed, Feb 25, 2009 at 7:48 PM, Ivan Raikov <ivan.g.rai...@gmail.com> wrote:
> For the time being, I have reverted srfi-18.scm to that of Chicken
> release 3.4.0. This fixes the issues you reported with srfi-18 and
> srfi-27.

I have restored the latest version of srfi-18 and fixed some bugs and
everything tests okay now.  The patch is attached below, and I have
also applied it to the repository.

Jim
Index: srfi-18.scm
===================================================================
--- srfi-18.scm (revision 13178)
+++ srfi-18.scm (working copy)
@@ -188,7 +188,7 @@
   (##sys#slot th 8) )
 
 (define-inline (%thread-mutexes-set! th wt)
-  (##sys#setslot th 8 wx) )
+  (##sys#setslot th 8 wt) )
 
 (define-inline (%thread-mutexes-empty? th)
   (null? (%thread-mutexes th)) )
@@ -399,7 +399,7 @@
   (max 0 (+ s C_startup_time_seconds)) )
 
 (define-inline (%seconds->milliseconds s)
-  (* (##sys#flonum-fraction (##sys#exact->inexact s)) 1000) )
+  (* s 1000) )
 
 (define-inline (%milliseconds->seconds ms)
   (/ ms 1000) )
@@ -473,17 +473,19 @@
   (set! make-thread
     (lambda (thunk #!optional (name (gensym 'thread)))
       (##sys#check-closure thunk 'make-thread)
-      (%make-thread
-       name
-       (lambda ()
-        (##sys#call-with-values
-         thunk
-         (lambda results
-           (%thread-results-set! thread results)
-           (##sys#thread-kill! thread 'dead)
-           (##sys#schedule))))))) )
+      (let ((thread (%make-thread name #f)))
+        (%thread-thunk-set!
+         thread 
+         (lambda ()
+           (##sys#call-with-values
+            thunk
+            (lambda results
+              (%thread-results-set! thread results)
+              (##sys#thread-kill! thread 'dead)
+              (##sys#schedule)))))
+        thread))) )
 
-(define (thread? x) (%thread x))
+(define (thread? x) (%thread? x))
 
 (define (current-thread) ##sys#current-thread)
 
@@ -611,7 +613,7 @@
     (lambda (#!optional (id (gensym 'mutex)))
       (%make-mutex id) ) ) )
 
-(define (mutex? x) (%mutex x))
+(define (mutex? x) (%mutex? x))
 
 (define (mutex-name mutex)
   (%check-mutex mutex 'mutex-specific)
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to