dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/libgc win32_threads.c,1.7,1.8


From: Thong Nguyen <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/libgc win32_threads.c,1.7,1.8
Date: Tue, 15 Jul 2003 15:52:07 -0400

Update of /cvsroot/dotgnu-pnet/pnet/libgc
In directory subversions:/tmp/cvs-serv13906/libgc

Modified Files:
        win32_threads.c 
Log Message:
Fix for GC's GC_CreateThread function not returning a duplicate handle



Index: win32_threads.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/win32_threads.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** win32_threads.c     6 Jul 2003 03:29:48 -0000       1.7
--- win32_threads.c     15 Jul 2003 19:52:04 -0000      1.8
***************
*** 440,444 ****
                    /* fill in ID and handle; tell child this is done */
                    thread_table[i].id = *lpThreadId;
!                   thread_table[i].handle = thread_h;
                    SetEvent (parent_ready_h);
  
--- 440,456 ----
                    /* fill in ID and handle; tell child this is done */
                    thread_table[i].id = *lpThreadId;
! 
!                       if (!DuplicateHandle(GetCurrentProcess(),
!                               thread_h,
!                               GetCurrentProcess(),
!                               (HANDLE*)&thread_table[i].handle,
!                               0,
!                               0,
!                               DUPLICATE_SAME_ACCESS)) {
!                                       DWORD last_error = GetLastError();
!                                       GC_printf1("Last error code: %lx\n", 
last_error);
!                                       ABORT("DuplicateHandle failed");
!                       }
!                   
                    SetEvent (parent_ready_h);
  
***************
*** 448,452 ****
                    /* suspend the child if requested */
                    if (dwCreationFlags & CREATE_SUSPENDED)
!                       SuspendThread (thread_h);
  
                    /* let child call given function now (or when resumed) */
--- 460,464 ----
                    /* suspend the child if requested */
                    if (dwCreationFlags & CREATE_SUSPENDED)
!                               SuspendThread (thread_table[i].handle);
  
                    /* let child call given function now (or when resumed) */
***************
*** 465,469 ****
  
      } else { /* no thread slot found */
!       SetLastError (ERROR_TOO_MANY_TCBS);
      }
  
--- 477,481 ----
  
      } else { /* no thread slot found */
!               SetLastError (ERROR_TOO_MANY_TCBS);
      }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]