This website works better with JavaScript.
Home
Explore
lain.church
Help
Register
Sign In
izaya
/
OC-PsychOS2
mirror of
https://git.shadowkat.net/izaya/OC-PsychOS2.git
Watch
1
Star
1
Fork
0
Code
Issues
0
Releases
0
Wiki
Activity
Browse Source
added a process_finished event and added syslog error reporting
master
XeonSquared
3 years ago
parent
be3d3c207f
commit
5938f75f4c
1 changed files
with
7 additions
and
1 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-1
module/sched.lua
+ 7
- 1
module/sched.lua
View File
@@ -2,7 +2,13 @@ do
local tTasks,nPid,nTimeout,cPid = {},1,0.25,0 -- table of tasks, next process ID, event timeout, current PID
local tTasks,nPid,nTimeout,cPid = {},1,0.25,0 -- table of tasks, next process ID, event timeout, current PID
function os.spawn(f,n) -- function string -- number -- creates a process from function *f* with name *n*
function os.spawn(f,n) -- function string -- number -- creates a process from function *f* with name *n*
tTasks[nPid] = {
tTasks[nPid] = {
c=coroutine.create(f), -- actual coroutine
c=coroutine.create(function()
local rt = {pcall(f)}
if not rt[1] then
syslog(rt[2])
end
computer.pushSignal("process_finished",os.pid(),table.unpack(rt))
end), -- actual coroutine
n=n, -- process name
n=n, -- process name
p=nPid, -- process PID
p=nPid, -- process PID
P=cPid, -- parent PID
P=cPid, -- parent PID
Write
Preview
Loading…
Cancel
Save