1 ! Copyright (C) 2008, 2010 Slava Pestov.
\r
2 ! See http://factorcode.org/license.txt for BSD license.
\r
3 USING: accessors assocs io io.styles kernel math.order
\r
4 math.parser prettyprint sequences sorting system threads ;
\r
7 : thread. ( thread -- )
\r
13 [ dup self eq? "running" "yield" ? ] unless*
\r
18 key>> nano-count [-] number>string write
\r
24 standard-table-style [
\r
26 { "ID:" "Name:" "Waiting on:" "Remaining sleep:" }
\r
27 [ [ write ] with-cell ] each
\r
30 threads sort-keys values [
\r
31 [ thread. ] with-row
\r
33 ] tabular-output nl ;
\r