rename process to priority

db4
Doug Coleman 2008-03-24 17:25:03 -05:00
parent b68e79726f
commit 1ff27e7de5
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,17 @@
USING: io.backend kernel ;
IN: io.priority
SYMBOL: +lowest-priority+
SYMBOL: +low-priority+
SYMBOL: +normal-priority+
SYMBOL: +high-priority+
SYMBOL: +highest-priority+
HOOK: current-priority io-backend ( -- symbol )
HOOK: set-current-priority io-backend ( symbol -- )
HOOK: priority-values ( -- assoc )
: lookup-priority ( symbol -- n )
priority-values at ;
HOOK: get-process-list io-backend ( -- assoc )

View File

@ -0,0 +1,19 @@
USING: alien.syntax kernel io.process io.unix.backend
unix ;
IN: io.unix.process
M: unix-io current-priority ( -- n )
clear_err_no
0 0 getpriority dup -1 = [ check-errno ] when ;
M: unix-io set-current-priority ( n -- )
0 0 rot setpriority io-error ;
M: unix-io priority-values ( -- assoc )
{
{ +lowest-priority+ 20 }
{ +low-priority+ 10 }
{ +normal-priority+ 0 }
{ +high-priority+ -10 }
{ +highest-priority+ -20 }
} ;

View File

@ -0,0 +1,8 @@
USING: kernel ;
IN: io.windows.process
M: windows-io current-priority ( -- n )
;
M: windows-io set-current-priority ( n -- )
;

View File

@ -0,0 +1,8 @@
USING: kernel ;
IN: io.windows.process
M: windows-io current-priority ( -- n )
;
M: windows-io set-current-priority ( n -- )
;