In both cases it's called from the end of WaitForCharOrMouse.
I'm not entirely sure I get all line numbers right, even when I compile vim 
with -g -O0, so I had to go with the "Fprintf to stderr"-monkey style :).

One further step in the stack trace:
ui_wait_for_chars_or_timer(...), the line "if (wait_func(due_time, interrupted, 
ignore_input))".
Due_time is -1, interrupted 1 and ignore input 0.

I guess it's the calls to has_pending_job() and channel_any_readahead() that 
decides if there are more to read? But wouldn't channel_any_readahead() require 
the message to have been parsed to json before returning TRUE?

An example flow when it works:
Channel_read - 63 bytes
Channel_parse_messages
Channel_parse_json
Channel_parse_json
Channel_parse_json
RealWaitForChar (from mch_breakcheck, with 0 timeout)

Then after a while:
Channel_read - 64 bytes
RealWaitForChar (from mch_breakcheck, with 0 timeout)
RealWaitForChar (from mch_breakcheck, with 0 timeout)
RealWaitForChar (from mch_breakcheck, with 0 timeout)
RealWaitForChar (from mch_breakcheck, with 0 timeout)
RealWaitForChar (from ui_wait_for_chars_or_timer as wait_func.. with -1 timeout)
// The select() call that hangs until keypressed
Channel_parse_messages
Channel_parse_json
Channel_parse_json
Channel_parse_json

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/25e08407-fd94-4924-a969-3b1a6e51777e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui