The MSDN states that the method returns
true if the method is successfully queued; NotSupportedException is thrown if the work item is not queued.
For testing purposes how to get the method to return false
? Or it is just a "suboptimal" class design?
In looking at the source code in Reflector, it seems the only part of the code that could return "false" is a call to the following:
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool AdjustThreadsInPool(uint QueueLength);
This is probably a case of "reserved for future use". You may want to treat it as failure, but it'll be hard to test.
I pretty much treat this method as a void/Sub.
It is imaginable that the entire API (thread-pools) becomes obsolete, when the Task Parallel Library (TPL) arrives.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With