CVSROOT: /sources/dotgnu-pnet
Module name: pnetlib
Branch:
Changes by: Heiko Weiss <[EMAIL PROTECTED]> 06/04/11 15:43:16
Modified files:
System.Windows.Forms: Control.cs
Log message:
fixed deadlock in invokes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnetlib/System.Windows.Forms/Control.cs.diff?tr1=1.120&tr2=1.121&r1=text&r2=text
Patches:
Index: pnetlib/System.Windows.Forms/Control.cs
diff -u pnetlib/System.Windows.Forms/Control.cs:1.120
pnetlib/System.Windows.Forms/Control.cs:1.121
--- pnetlib/System.Windows.Forms/Control.cs:1.120 Tue Apr 11 15:34:08 2006
+++ pnetlib/System.Windows.Forms/Control.cs Tue Apr 11 15:43:16 2006
@@ -332,21 +332,30 @@
// Implement the ISynchronizeInvoke interface.
private void ProcessInvokeEvent(IntPtr i_gch)
{
- lock( this.invokeEventQueue ) {
+ while( true ) {
+ InvokeParameters iParm = null;
- while( this.invokeEventQueue.Count > 0 ) {
- InvokeParameters iParm = (InvokeParameters)
invokeEventQueue.Dequeue();
-
- Delegate dg = iParm.method;
- Object ro = dg.DynamicInvoke(iParm.args);
-
- InvokeAsyncResult ar = iParm.wr;
+ lock( this.invokeEventQueue ) {
- if( ar != null )
- {
- ar.retObject = ro;
- ar.SetComplete();
+ if( this.invokeEventQueue.Count > 0 ) {
+ iParm = (InvokeParameters)
invokeEventQueue.Dequeue();
}
+ else {
+ iParm = null;
+ }
+ }
+
+ if( null == iParm ) break; // no more items
+
+ Delegate dg = iParm.method;
+ Object ro = dg.DynamicInvoke(iParm.args);
+
+ InvokeAsyncResult ar = iParm.wr;
+
+ if( ar != null )
+ {
+ ar.retObject = ro;
+ ar.SetComplete();
}
}
}
_______________________________________________
dotgnu-pnet-commits mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/dotgnu-pnet-commits