From 6ad21dfbb88b008526fd7441210df5534eb452ea Mon Sep 17 00:00:00 2001 From: letouzey Date: Tue, 22 Jan 2013 23:57:42 +0000 Subject: Coqide: avoid potentially blocking read on coqtop channel With Pierre-Marie, we discovered the hard way that Glib.Io reads are *not* non-blocking by default as I thought. My bad... This was causing nasty freezes of coqide in the rare cases where the final read was exactly filling the buffer (which was of size 1024). Now: - the input channels from coqtop (and various other external commands) are given to Unix.set_nonblock - Exceptions in our io_read_all (typically a kind of EAGAIN) terminate the read - We can now switch to Glib.Io.read_chars instead of the deprecated Glib.Io.read. - Btw, we use a larger buffer (8192). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16138 85f007b7-540e-0410-9357-904b9bb8a0f7 --- ide/ideutils.mli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ide/ideutils.mli') diff --git a/ide/ideutils.mli b/ide/ideutils.mli index 87ddb2a95..cc34a355a 100644 --- a/ide/ideutils.mli +++ b/ide/ideutils.mli @@ -80,7 +80,8 @@ val stat : string -> stats val read_file : string -> Buffer.t -> unit -(** Read the available content on some gtk asynchronous input channel *) +(** Read what is available on a gtk input channel. + This channel should have been set as non-blocking. *) val io_read_all : Glib.Io.channel -> string -- cgit v1.2.3