class A waiting on ManualResetEvent from Thread in different class? [C#]
<p>I have a parent thread (non-UI) which creates some child threads to do some jobs, these children are from a different class (sounds odd but the code sample will illustrate it) - at some point the parent must wait for certain tasks to be completed by the child thread - this does not mean the child is finished but only that it has reached a certain point and the parent can now continue processing ...</p>

<p>Obviously this is a sample to illustrate my situation ... life isn't this simple :)
(sorry for the repost - was trying to add this as a comment to my previous one but the code never came out right)...</p>

<pre><code>class A
{
private ManualResetEvent manualResetEvent;

public A()
    {
    manualResetEvent = new ManualResetEvent(false);
    B child = new B();

    if (manualResetEvent;.WaitOne(1000, false))
        {
        ... do the work I was waiting on ...
        }
    }
};


Class B
{
public B()
    {
    Thread childThread = new Thread(new ThreadStart(Manage));
    childThread.IsBackground = true;
    childThread.Name = "NamedPipe Manager";
    childThread.Start();

    private void Manage()
        {
        ... do some work ...
        ... call some functions ...

        // SIGNAL TO Class A THAT IT CAN CONTINUE //
        manualResetEvent.Set(); // this won't compile because obviously it has no clue what manualResetEvent is ... different class

        ... do more work ...
        ... call more functions ...
        }
    }
};
</code></pre>

<p>As you can see, this is a little different then before ... now we have two different classes (A &amp; B) - the problem this raises is that B cannot see A's manualResetEvent and therefore cannot do .Set to notify it ... </p>

<p>Any one have any suggestions on how I can accomplish this task in a thread-safe manner?
Any help would be much appreciated.
Thanks,</p>
