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

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

[Dotgnu-pnet-commits] CVS: pnet/support hb_gc.c,1.20,1.21


From: Thong Nguyen <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/support hb_gc.c,1.20,1.21
Date: Tue, 15 Jul 2003 21:30:47 -0400

Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv24224

Modified Files:
        hb_gc.c 
Log Message:
Prevents finalizers from recursively calling finalizers in single threaded 
environments.
nCVS: ----------------------------------------------------------------------


Index: hb_gc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/hb_gc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** hb_gc.c     15 Jul 2003 22:17:33 -0000      1.20
--- hb_gc.c     16 Jul 2003 01:30:45 -0000      1.21
***************
*** 175,184 ****
                return 0;
        }
        
        /* If threading isn't supported then invoke the finalizers 
synchronously */
  
!       if (!ILHasThreads() || _FinalizerThread == 0)
        {
                GC_invoke_finalizers();
  
                return 1;
--- 175,195 ----
                return 0;
        }
+ 
+       if (_FinalizersRunning || ILThreadSelf() == _FinalizerThread)
+       {
+               /* Finalizer thread can't recursively call finalizers */
+               
+               return 0;
+       }
        
        /* If threading isn't supported then invoke the finalizers 
synchronously */
  
!       if (!ILHasThreads())
        {
+               _FinalizersRunning = 1;
+               
                GC_invoke_finalizers();
+               
+               _FinalizersRunning = 0;
  
                return 1;
***************
*** 191,201 ****
        }
        
-       if (ILThreadSelf() == _FinalizerThread)
-       {
-               /* Finalizer thread can't recursively call finalizers */
-               
-               return 0;
-       }
- 
        /* Start the finalizer thread if it hasn't been started */
  
--- 202,205 ----





reply via email to

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