Skip to content

Commit 20c7386

Browse files
committed
making scheduler available in batch-mode programs
1 parent 753513a commit 20c7386

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

j/client.j

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ function run_repl()
1414
ccall(:repl_callback_enable, Void, ())
1515

1616
while true
17+
roottask_wi.requeue = false
1718
add_fd_handler(STDIN.fd, fd->ccall(:jl_stdin_callback, Void, ()))
1819
(ast, show_value) = yield()
1920
del_fd_handler(STDIN.fd)
2021
roottask_wi.requeue = true
2122
ccall(:jl_eval_user_input, Void, (Any, Int32),
2223
ast, show_value)
23-
roottask_wi.requeue = false
2424
end
2525
end
2626

@@ -144,6 +144,9 @@ function _start()
144144
# start in "head node" mode
145145
global Scheduler = Task(()->event_loop(true), 1024*1024)
146146
global PGRP = ProcessGroup(1, {LocalProcess()}, {Location("",0)})
147+
# make scheduler aware of current (root) task
148+
enq_work(roottask_wi)
149+
yield()
147150
else
148151
global PGRP = ProcessGroup(0, {}, {})
149152
end

0 commit comments

Comments
 (0)