Posted to tcl by dbohdan at Tue Mar 26 09:18:25 GMT 2019view raw
- proc sleepsort intlist {
- set ::result {}
- set ::count 0
- foreach n $intlist {
- after $n [list apply {n {
- lappend ::result $n
- incr ::count
- }} $n]
- }
- while {$::count < [llength $intlist]} {
- vwait ::count
- }
- return $::result
- }