From: Matt Birkholz Date: Fri, 1 Jun 2018 21:15:27 +0000 (-0700) Subject: Add optional name parameter to create-thread. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~6^2~10 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a47f7b1f81a9b122168210fdd859f85017fb5890;p=mit-scheme.git Add optional name parameter to create-thread. --- diff --git a/src/runtime/thread.scm b/src/runtime/thread.scm index 0ca02f92b..4691a9a40 100644 --- a/src/runtime/thread.scm +++ b/src/runtime/thread.scm @@ -210,7 +210,7 @@ USA. (guarantee thread? thread 'thread-execution-state) (thread/execution-state thread)) -(define (create-thread root-continuation thunk) +(define (create-thread root-continuation thunk #!optional name) (if (not (or (not root-continuation) (continuation? root-continuation))) (error:wrong-type-argument root-continuation "continuation or #f" @@ -226,6 +226,9 @@ USA. (call-with-current-continuation (lambda (continuation) (let ((thread (make-thread continuation))) + (if (not (default-object? name)) + (1d-table/put! (thread/properties thread) + 'name name)) (%within-continuation (let ((k return)) (set! return #f) k) #t (lambda () thread)))))