Skip to content

Commit cf3c928

Browse files
authored
Merge pull request #326 from macvim-dev/fix/job_fail
Use global queue in order to catch read event from channel
2 parents fa52c64 + c617acf commit cf3c928

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/MacVim/gui_macvim.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,13 +2260,19 @@ static int vimModMaskToEventModifierFlags(int mods)
22602260
void *
22612261
gui_macvim_add_channel(channel_T *channel, int part)
22622262
{
2263+
dispatch_queue_t q =
2264+
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
22632265
dispatch_source_t s =
22642266
dispatch_source_create(DISPATCH_SOURCE_TYPE_READ,
22652267
channel->ch_part[part].ch_fd,
22662268
0,
2267-
dispatch_get_main_queue());
2269+
q);
22682270
dispatch_source_set_event_handler(s, ^{
2269-
channel_read(channel, part, "gui_macvim_add_channel");
2271+
dispatch_suspend(s);
2272+
dispatch_async(dispatch_get_main_queue(), ^{
2273+
channel_read(channel, part, "gui_macvim_add_channel");
2274+
dispatch_resume(s);
2275+
});
22702276
});
22712277
dispatch_resume(s);
22722278
return s;

0 commit comments

Comments
 (0)