Chuck Mason wrote:
> This crashes my vim:
>
> function! PyCrash()
> python << EOF
> import sys
> sys.path.append("c:\\python23\\lib")
> from threading import Thread
> import vim
>
> def f():
> vim.command("copen")
>
> t = Thread(target=f)
> t.start()
> EOF
> endfunc
>
> "" crash!
> call PyCrash()
>
> Does anyone know why? I mean, granted vim.command might not be
> thread-safe but it most certainly shouldn't crash.
There are a few calls in the Python interface to make sure everything
happens in one thread. However, how this works appears to change with
every version of Python, so it might not work with Python 2.4. It might
actually be this thread-protection code that causes the crash.
Perhaps someone who knows how these things work can have a look at
src/if_python.c. Search for "thread\c".
--
Our job was to build a computer information system for the branch banks. We
were the perfect people for the job: Dean had seen a computer once, and I had
heard Dean talk about it.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///