Home All Groups Group Topic Archive Search About

Using ManualResetEvent within a ContextBoundObject

Author
22 Mar 2006 2:50 PM
Amir Shitrit
For some reason, I tried to create an instance of the ManualResetEvent class
from the constructor of a class that derives from ContextBoundObject (for
automatic synchronization purposes), and after the call to "new
ManualResetEvent(false)" the watch window shows "undefied value" / null for
that instance, altough a call to Debug.Assert(event != null) doesn't assert!
Moreover, when I try to call Set on the event, an exception is thrown (can't
access a disposed object or something like that), even though I didn't
dispose of the event.
Is there a special problem regarding the use of ManualResetEvent in
ContextBoundObjects?
What is the reason for this?
Thanks.

Author
26 Mar 2006 10:57 PM
Amir Shitrit
My mistake.
Please ignore this message.

Show quote
"Amir sh*trit" wrote:

> For some reason, I tried to create an instance of the ManualResetEvent class
> from the constructor of a class that derives from ContextBoundObject (for
> automatic synchronization purposes), and after the call to "new
> ManualResetEvent(false)" the watch window shows "undefied value" / null for
> that instance, altough a call to Debug.Assert(event != null) doesn't assert!
> Moreover, when I try to call Set on the event, an exception is thrown (can't
> access a disposed object or something like that), even though I didn't
> dispose of the event.
> Is there a special problem regarding the use of ManualResetEvent in
> ContextBoundObjects?
> What is the reason for this?
> Thanks.

AddThis Social Bookmark Button