From 5c7c47b1ffe5b1f679c32f89eb64e9a768be1542 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Sat, 28 Dec 2013 12:37:45 -0500 Subject: [PATCH] fix #5248 block REPL I/O task while evaluating input --- base/client.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/client.jl b/base/client.jl index 8e986958f4ddf..2b7c55dce17e3 100644 --- a/base/client.jl +++ b/base/client.jl @@ -142,6 +142,8 @@ function repl_callback(ast::ANY, show_value) put(repl_channel, (ast, show_value)) end +_eval_done = Condition() + function run_repl() global const repl_channel = RemoteRef() @@ -155,7 +157,7 @@ function run_repl() read(STDIN, buf) ccall(:jl_read_buffer,Void,(Ptr{Void},Cssize_t),buf,1) if _repl_enough_stdin - yield() + wait(_eval_done) end end put(repl_channel,(nothing,-1)) @@ -175,6 +177,7 @@ function run_repl() break end eval_user_input(ast, show_value!=0) + notify(_eval_done) end if have_color