I'm sorry but this is never
enough information for me to actually solve a problem.
If you report that exceptions are being thrown, then it would be
useful to tell what exceptions are being thrown. A call stack would be useful
too.
My reader write gate already returns an IAsyncResult so I don't
why you would need to wrap it - I don't know what your wrapper does and if you
implemented it correctly.
A small repro case would be very handy.
There is always the possibility that I have a bug since you are
the only person reporting a bug in a very highly-used class, more than likely
the bug is not in my code.
--
Jeffrey Richter (http://Wintellect.com)
From:
PowerThreading@yahoogroups.com [mailto:PowerThreading@yahoogroups.com] On
Behalf Of wynandjordaan@...
Sent: Monday, June 22, 2009 1:43 PM
To: PowerThreading@yahoogroups.com
Subject: [PowerThreading] Exception in AsyncResult
Hi,
I think there is some problem with the new version of the AsyncResult. I have
the following code for example:
IAsyncResult result = BeginWriteAccess(RequestNetworkConnection, ConnectionData,
messageResult);
result.AsyncWaitHandle.WaitOne();
I get two exceptions sometime at the WaitOne() line. My BeginReadAccess returns
an AsyncResult and is just a wrapper for the Read Writer Gate. This process has
to be a blocking process.
When I implement the AsyncResultNoValue then I dont get these exceptions. I
beleive there is some thread issue with the AsyncResult in the new version.
This process complete quite quickly and think thats why it throws an exeption.
Is this AsyncResult not supposed to be used like this?
Kind regards,
Wynand Jordaan.