chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] mutex-lock! sometimes not srfi-18 compliant


From: Jörg F. Wittenberger
Subject: [Chicken-hackers] [PATCH] mutex-lock! sometimes not srfi-18 compliant
Date: Sat, 07 Nov 2015 21:55:21 +0100
User-agent: Mozilla/5.0 (X11; Linux armv7l; rv:31.0) Gecko/20100101 Icedove/31.7.0

Hi,

try the test case:

(use srfi-18)
;; Make a locked mutex
(define mux (make-mutex 'foo))
(mutex-lock! mux #f #f)

;; Have a thread waiting for it.

(define t1
  (thread-start!
   (lambda ()
    (mutex-lock! mux #f #f)
    (print "Got " mux " state " (mutex-state mux) "\n"))))

;; Give it time to actually wait.

(thread-sleep! 1)

;; Let it lock the mux

(mutex-unlock! mux)

(exit 0)

-----

>From my reading of srfi-18 I would expect it to print

   Got #<mutex> state not-owned

but it prints

   Got #<mutex> state #<thread: thread7>

With the attached patch it prints what I'd expect.

Best

/Jörg


Attachment: 0001-mutex-lock.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]