Skip to content

Commit

Permalink
fix #5248
Browse files Browse the repository at this point in the history
block REPL I/O task while evaluating input
  • Loading branch information
JeffBezanson committed Dec 28, 2013
1 parent e800837 commit 5c7c47b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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))
Expand All @@ -175,6 +177,7 @@ function run_repl()
break
end
eval_user_input(ast, show_value!=0)
notify(_eval_done)
end

if have_color
Expand Down

0 comments on commit 5c7c47b

Please sign in to comment.