projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix int -> size_t api change. Might break some 64bits configurations.
[mono.git]
/
libgc
/
win32_threads.c
diff --git
a/libgc/win32_threads.c
b/libgc/win32_threads.c
index 87944dc375ff986313a60288a9ca1eec8691f0dd..9662eb186ceb1f5f69184d47070e08670f309a72 100644
(file)
--- a/
libgc/win32_threads.c
+++ b/
libgc/win32_threads.c
@@
-283,8
+283,15
@@
void GC_stop_world()
# endif
continue;
}
# endif
continue;
}
- if (SuspendThread(thread_table[i].handle) == (DWORD)-1)
- ABORT("SuspendThread failed");
+ if (SuspendThread(thread_table[i].handle) == (DWORD)-1) {
+ thread_table[i].stack_base = 0; /* prevent stack from being pushed */
+# ifndef CYGWIN32
+ /* this breaks pthread_join on Cygwin, which is guaranteed to */
+ /* only see user pthreads */
+ thread_table[i].in_use = FALSE;
+ CloseHandle(thread_table[i].handle);
+# endif
+ }
# endif
thread_table[i].suspended = TRUE;
}
# endif
thread_table[i].suspended = TRUE;
}
@@
-379,6
+386,10
@@
void GC_push_all_stacks()
# if defined(I386)
PUSH4(Edi,Esi,Ebx,Edx), PUSH2(Ecx,Eax), PUSH1(Ebp);
sp = (ptr_t)context.Esp;
# if defined(I386)
PUSH4(Edi,Esi,Ebx,Edx), PUSH2(Ecx,Eax), PUSH1(Ebp);
sp = (ptr_t)context.Esp;
+# elif defined(X86_64)
+ PUSH4(Rax,Rcx,Rdx,Rbx); PUSH2(Rbp, Rsi); PUSH1(Rdi);
+ PUSH4(R8, R9, R10, R11); PUSH4(R12, R13, R14, R15);
+ sp = (ptr_t)context.Rsp;
# elif defined(ARM32)
PUSH4(R0,R1,R2,R3),PUSH4(R4,R5,R6,R7),PUSH4(R8,R9,R10,R11),PUSH1(R12);
sp = (ptr_t)context.Sp;
# elif defined(ARM32)
PUSH4(R0,R1,R2,R3),PUSH4(R4,R5,R6,R7),PUSH4(R8,R9,R10,R11),PUSH1(R12);
sp = (ptr_t)context.Sp;
@@
-771,7
+782,7
@@
int GC_pthread_detach(pthread_t thread)
* Pontus Rydin suggests wrapping the thread start routine instead.
*/
#if defined(GC_DLL) || defined(GC_INSIDE_DLL)
* Pontus Rydin suggests wrapping the thread start routine instead.
*/
#if defined(GC_DLL) || defined(GC_INSIDE_DLL)
-BOOL WINAPI DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
+BOOL WINAPI
GC_
DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
{
switch (reason) {
case DLL_PROCESS_ATTACH: