Just now I translated Jon Skeet's WaitHandle.Wait Any / .WaitAll
(<http://yoda.arachsys.c om/csharp/threads/waithandles.sht ml>) from C#
into VB.NET, and after the first go I ran into trouble:
(from the docs for WaitHandle.Wait All)
NotSupportedExc eption The number of objects in waitHandles is greater
than the system permits.
-or-
The current thread is marked with the STAThreadAttrib ute, and
waitHandles contains more than one element.
After digging a bit, I came to the conclusion that VB.NET apps, even
ones that aren't explicitly marked for COM Interop, are STA threaded by
default, so a simple application of the MTAThread attribute to my Main
method fixed the problem.
However, what would I do if I had a real app that *needed* to be
STAThread'd, and I wanted to wait for multiple signals? The docs offer
no justification, just a blunt
Note The WaitAll method is not supported on threads that are marked
with STAThreadAttrib ute.
Why not? And what could one do about it?
--
Larry Lard
Replies to group please