https://bugzilla.novell.com/show_bug.cgi?id=394365


           Summary: Incorrect BackgroundWorker.IsBusy return value
           Product: Mono: Class Libraries
           Version: SVN
          Platform: i386
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


According to
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.isbusy.aspx

IsBusy should return "true, if the BackgroundWorker is running an asynchronous
operation; otherwise, false."

In the Mono implementation available at
http://anonsvn.mono-project.com/source/trunk/mcs/class/System/System.ComponentModel/BackgroundWorker.cs
the value returned by depends on whether the async instance variable is null or
not.

However, in two places, async is set to null only after the RunWorkerCompleted
event handler is executed (lines 86 and 149). Consequently, the event handler
"sees" IsBusy as true when it should be false. This behavior is not consistent
with MS's .NET implementation.

The included test case (bgw.cs) exposes the problem; it prints "True" when it
should print "False".

A possible solution would be to move the two "this.async = null;" statements
before the corresponding calls to OnRunWorkerCompleted. This seems to fix the
problem.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to