📄 bgjobsupport.pro
字号:
/*****************************************************************************
Copyright (c) Prolog Development Center A/S
******************************************************************************/
implement bgJobSupport
open core
constants
className = "background/backgroundSupport/bgJobSupport".
classVersion = "$JustDate: 2004-10-02 $$Revision: 1 $".
clauses
startJob(Job) = startJob(Job, multiThread_native::thread_priority_lowest).
class predicates
startJob : (bgJob Job, multiThread_native::threadPriority Priority) -> thread JobThread.
clauses
startJob(Job, Priority) = Thread :-
J = bgJobSupport::new(Job),
Thread = thread::createSuspended(J:run),
Thread:setPriority(Priority),
_ = Thread:resume().
facts
job : bgJob.
clauses
new(Job) :-
job := Job.
clauses
run() :-
job:job(),
bgSynchronizer::postResult(job).
clauses
makeRunnablePersistent(Runnable) = uncheckedConvert(runnable, Mem) :-
Size = 8,
Mem = memory::allocHeap(Size),
memory::move(Mem, uncheckedConvert(pointer, Runnable), Size).
clauses
classInfo(className, classVersion).
end implement bgJobSupport
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -