OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 #include "primpl.h" | 6 #include "primpl.h" |
7 #include <process.h> /* for _beginthreadex() */ | 7 #include <process.h> /* for _beginthreadex() */ |
8 | 8 |
9 #if defined(_MSC_VER) && _MSC_VER <= 1200 | 9 #if defined(_MSC_VER) && _MSC_VER <= 1200 |
10 /* | 10 /* |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 PRThreadState state, | 99 PRThreadState state, |
100 PRUint32 stackSize) | 100 PRUint32 stackSize) |
101 { | 101 { |
102 | 102 |
103 thread->md.start = start; | 103 thread->md.start = start; |
104 thread->md.handle = (HANDLE) _beginthreadex( | 104 thread->md.handle = (HANDLE) _beginthreadex( |
105 NULL, | 105 NULL, |
106 thread->stack->stackSize, | 106 thread->stack->stackSize, |
107 pr_root, | 107 pr_root, |
108 (void *)thread, | 108 (void *)thread, |
109 CREATE_SUSPENDED, | 109 CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, |
110 &(thread->id)); | 110 &(thread->id)); |
111 if(!thread->md.handle) { | 111 if(!thread->md.handle) { |
112 return PR_FAILURE; | 112 return PR_FAILURE; |
113 } | 113 } |
114 | 114 |
115 thread->md.id = thread->id; | 115 thread->md.id = thread->id; |
116 /* | 116 /* |
117 * On windows, a thread is created with a thread priority of | 117 * On windows, a thread is created with a thread priority of |
118 * THREAD_PRIORITY_NORMAL. | 118 * THREAD_PRIORITY_NORMAL. |
119 */ | 119 */ |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 #pragma data_seg(".CRT$XLB") | 429 #pragma data_seg(".CRT$XLB") |
430 PIMAGE_TLS_CALLBACK p_thread_callback_nspr = PR_OnThreadExit; | 430 PIMAGE_TLS_CALLBACK p_thread_callback_nspr = PR_OnThreadExit; |
431 | 431 |
432 // Reset the default section. | 432 // Reset the default section. |
433 #pragma data_seg() | 433 #pragma data_seg() |
434 | 434 |
435 #endif // _WIN64 | 435 #endif // _WIN64 |
436 | 436 |
437 #endif // NSPR_STATIC | 437 #endif // NSPR_STATIC |
OLD | NEW |