Strange behaviour of release-foreground with optional parameter 'next'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
In toplevel REPL, run this code :
(let ((thread2 (sb-thread:
(sb-
(print (sb-thread:
(finish-
=>
"2"
(#<SB-THREAD:THREAD "Thread 2" FINISHED values: "2" {1001FC20D3}>
#<SB-THREAD:THREAD "main thread" RUNNING {1001F0E473}>)
NIL
Calling release-foreground places "Thread 2" in the interactive threads list but "main thread" remains in the list too. If there were several threads in the list, "main thread" would have been removed from the list.
So when giving foreground to another thread, current thread is removed from the list or not, depending of the state of the list, which is strange because there *is* another thread to place in the list. And keeping current thread in the list implies this thread will get foreground when 'next' thread looses it (ends / release foreground), so future behaviour depends on current state of the list.
In release-foreground, I think "(when next ...)" should be before "(when (rest ...))" : next interactive thread would be systemaically placed in the list and current thread would by systemaically removed from the list.
Maybe there is a special case if current thread is 'next' thread. Probably nothing should happen at all.
------------
$ sbcl --version
SBCL 1.3.15
$ uname -a
Linux yggdrasil 4.10.9-1-ARCH #1 SMP PREEMPT Sat Apr 8 12:39:59 CEST 2017 x86_64 GNU/Linux
* *features*
(:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
:C-STACK-
:COMPARE-
:FP-AND-
:IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
:LINUX :LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-INSTANCE-
:SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-THREAD :SB-UNICODE :SBCL :STACK-
:STACK-
:STACK-
:UNBIND-N-VOP :UNDEFINED-
:X86-64)
Changed in sbcl: | |
status: | New → In Progress |
importance: | Undecided → Low |
assignee: | nobody → Jan Moringen (scymtym) |
Changed in sbcl: | |
status: | In Progress → Fix Committed |
assignee: | Jan Moringen (scymtym) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |