Xavier de Gaye <xdeg...@gmail.com>: > On Sat, Nov 19, 2011 at 8:33 AM, Jan Larres wrote: >>> The problem is that the python interface in Vim is not thread safe. >> >> That's what I was worried about. I assume there's no easy way to fix >> this then, other than using a higher sleep() value. But that just seems >> wrong, especially since it can randomly lead to segfaults :( > > In libclang.py, the getCurrentTranslationUnit() function starts with: > > def getCurrentTranslationUnit(args, update = False): > currentFile = getCurrentFile() > fileName = vim.current.buffer.name > ... > > If 'currentFile' and 'fileName' are evaluated outside the thread > instead of in the thread, then no calls to the Vim python interface > are made within the thread anymore. This can be done by having the > 'CompleteThread' class initialised with 'currentFile' and 'filename'. > The following patch attempts to do that (not tested):
That indeed seems to have fixed it! Thanks a lot! :) Jan -- -[ OpenPGP key ID: 00A0FD5F ]- If Jesus had been killed 20 years ago, Catholic school children would be wearing little Electric Chairs around their necks instead of crosses. -- Lenny Bruce -- 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