mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
srfi-18: Use `match' in thread-start!.
* module/srfi/srfi-18.scm (thread-start!): Use `match'.
This commit is contained in:
parent
501c0e67b1
commit
4d23c835c4
1 changed files with 10 additions and 9 deletions
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
(define-module (srfi srfi-18)
|
(define-module (srfi srfi-18)
|
||||||
#:use-module ((ice-9 threads) #:prefix threads:)
|
#:use-module ((ice-9 threads) #:prefix threads:)
|
||||||
|
#:use-module (ice-9 match)
|
||||||
#:use-module (srfi srfi-34)
|
#:use-module (srfi srfi-34)
|
||||||
#:export (;; Threads
|
#:export (;; Threads
|
||||||
make-thread
|
make-thread
|
||||||
|
@ -210,15 +211,15 @@
|
||||||
*unspecified*)
|
*unspecified*)
|
||||||
|
|
||||||
(define (thread-start! thread)
|
(define (thread-start! thread)
|
||||||
(let ((x (hashq-ref thread-start-conds
|
(match (hashq-ref thread-start-conds
|
||||||
(check-arg-type threads:thread? thread "thread-start!"))))
|
(check-arg-type threads:thread? thread "thread-start!"))
|
||||||
(and x (let ((smutex (car x))
|
((smutex . scond)
|
||||||
(scond (cdr x)))
|
(hashq-remove! thread-start-conds thread)
|
||||||
(hashq-remove! thread-start-conds thread)
|
(threads:lock-mutex smutex)
|
||||||
(threads:lock-mutex smutex)
|
(threads:signal-condition-variable scond)
|
||||||
(threads:signal-condition-variable scond)
|
(threads:unlock-mutex smutex))
|
||||||
(threads:unlock-mutex smutex)))
|
(#f #f))
|
||||||
thread))
|
thread)
|
||||||
|
|
||||||
(define (thread-yield!) (threads:yield) *unspecified*)
|
(define (thread-yield!) (threads:yield) *unspecified*)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue