This only applies when using COM+ synchronization (System.EnterpriseServices.SynchronizationAttribute and ContextBoundObject). If you exit the synch domain, then another thread can come and use the method while you are waiting. Otherwise you continue to hold the lock used for COM+ synchronization while you wait. If you want all the gory details, check out Transactional COM+ by Tim Ewald (still very relevant even if you never write a line of COM code).
My big complaint with this is that there is no reason why specifying a timeout should be coupled with specifying the exit domain parameter - they are completely unrelated. There should really be two more WaitOne overrides - one that takes just a timeout and one that takes just an exitDomain. Most .NET programmers are probably never going to use COM+ Synchronization, so it's pretty amazing how often this question comes up. And of course the documentation should indicate that when you don't specify otherwise, the default is to exit the domain (like you, I had to go to Rotor/Reflector to figure this out). I've provided this feedback to Microsoft, and they said: "Thanks for the feedback, Rick! You're right, it doesn't make much sense to couple timeouts with exiting the context. Future versions of the documentation will mention that exitContext is false for the parameterless WaitOne, WaitAny, and WaitAll." Rick ----- Original Message ----- From: "Chris Mullins" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 12, 2004 7:44 PM Subject: Synchronization Domain and Wait Handles > The WaitHandle.WaitOne method takes two parameters, a timeout and a > Boolean value that the help described as "true to exit the > synchronization domain for the context before the wait (if in a > synchronized context), and reacquire it; otherwise, false." > > Try as I might, I have been unable to figure out what the second > parameter actually does. The MSDN help makes no mention of > "synchronization domains", and every multi-threaded test I have run to > try to figure this out has made no difference. > > I went through the Rotor implementation of WaitHanle, and discovered > that the default value is "false", but other than that, was unable to > figure out what this is doing. > > Anyone have any idea what this parameter means? > > -- > Chris Mullins > > =================================== > This list is hosted by DevelopMentor� http://www.develop.com > Some .NET courses you may be interested in: > > NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles > http://www.develop.com/courses/gaspdotnetls > > View archives and manage your subscription(s) at http://discuss.develop.com > =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
