To: vim_dev@googlegroups.com Subject: Patch 7.4.2145 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2145 Problem: Win32: Using CreateThread/ExitThread is not safe. Solution: Use _beginthreadex and return from the thread. (Ken Takata) Files: src/os_win32.c *** ../vim-7.4.2144/src/os_win32.c 2016-07-01 17:17:13.290266761 +0200 --- src/os_win32.c 2016-08-02 21:52:20.682760304 +0200 *************** *** 4267,4273 **** /* finished all the lines, close pipe */ CloseHandle(g_hChildStd_IN_Wr); ! ExitThread(0); } --- 4267,4273 ---- /* finished all the lines, close pipe */ CloseHandle(g_hChildStd_IN_Wr); ! return 0; } *************** *** 4491,4498 **** if (options & SHELL_WRITE) { ! HANDLE thread = ! CreateThread(NULL, /* security attributes */ 0, /* default stack size */ sub_process_writer, /* function to be executed */ g_hChildStd_IN_Wr, /* parameter */ --- 4491,4498 ---- if (options & SHELL_WRITE) { ! HANDLE thread = (HANDLE) ! _beginthreadex(NULL, /* security attributes */ 0, /* default stack size */ sub_process_writer, /* function to be executed */ g_hChildStd_IN_Wr, /* parameter */ *** ../vim-7.4.2144/src/version.c 2016-08-02 21:41:18.548944510 +0200 --- src/version.c 2016-08-02 21:53:27.666134869 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2145, /**/ -- How come wrong numbers are never busy? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///