* thread_win32.c (thread_errno): CreateThread does not set errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7d63dfd28
commit
9e0f3e0db9
@ -1,4 +1,6 @@
|
|||||||
Thu Nov 12 13:57:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Nov 12 14:33:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* thread_win32.c (thread_errno): CreateThread does not set errno.
|
||||||
|
|
||||||
* thread.c (thread_create_core): moved failure handling from
|
* thread.c (thread_create_core): moved failure handling from
|
||||||
native_thread_core().
|
native_thread_core().
|
||||||
|
@ -176,9 +176,11 @@ w32_resume_thread(HANDLE handle)
|
|||||||
|
|
||||||
#ifdef HAVE__BEGINTHREADEX
|
#ifdef HAVE__BEGINTHREADEX
|
||||||
#define start_thread (HANDLE)_beginthreadex
|
#define start_thread (HANDLE)_beginthreadex
|
||||||
|
#define thread_errno errno
|
||||||
typedef unsigned long (_stdcall *w32_thread_start_func)(void*);
|
typedef unsigned long (_stdcall *w32_thread_start_func)(void*);
|
||||||
#else
|
#else
|
||||||
#define start_thread CreateThread
|
#define start_thread CreateThread
|
||||||
|
#define thread_errno rb_w32_map_errno(GetLastError())
|
||||||
typedef LPTHREAD_START_ROUTINE w32_thread_start_func;
|
typedef LPTHREAD_START_ROUTINE w32_thread_start_func;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -479,7 +481,7 @@ native_thread_create(rb_thread_t *th)
|
|||||||
th->thread_id = w32_create_thread(stack_size, thread_start_func_1, th);
|
th->thread_id = w32_create_thread(stack_size, thread_start_func_1, th);
|
||||||
|
|
||||||
if ((th->thread_id) == 0) {
|
if ((th->thread_id) == 0) {
|
||||||
return errno ? errno : -1;
|
return thread_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
w32_resume_thread(th->thread_id);
|
w32_resume_thread(th->thread_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user