Mutex Releasing [modified]
-
Hi All, I have located a Mutex system in code outside my control which causes execution to be delayed until after the current process has completed (Sequential). Inside this Mutex system events are raised, which seems to lead to events being raised only after the current process has completed. This doesn't help my unit tests as the events which should supply the results only occur after the test has failed. :( So my question is, is there any way to suspend the thread and free the Mutex (Which i have no direct access too), so that it can do it's work, raise it's event etc. before continuing? I've tried Thread.Spin(), Thread.Sleep() and Application.DoEvents() as ways of suspending execution, but they don't seem to work. Any thoughts? Regards Tris [Edit: The Mutex appears to be owned by a different thread to the executing one.]
------------------------------- Carrier Bags - 21st Century Tumbleweed.
modified on Thursday, May 7, 2009 5:25 AM
-
Hi All, I have located a Mutex system in code outside my control which causes execution to be delayed until after the current process has completed (Sequential). Inside this Mutex system events are raised, which seems to lead to events being raised only after the current process has completed. This doesn't help my unit tests as the events which should supply the results only occur after the test has failed. :( So my question is, is there any way to suspend the thread and free the Mutex (Which i have no direct access too), so that it can do it's work, raise it's event etc. before continuing? I've tried Thread.Spin(), Thread.Sleep() and Application.DoEvents() as ways of suspending execution, but they don't seem to work. Any thoughts? Regards Tris [Edit: The Mutex appears to be owned by a different thread to the executing one.]
------------------------------- Carrier Bags - 21st Century Tumbleweed.
modified on Thursday, May 7, 2009 5:25 AM
Sorry, I don't understand your description. But you could use a named Mutex. So you could get access to this Mutex. The Mutex can just be freed by the thread owning it. Is this the thing you mean with no direct access?
-
Sorry, I don't understand your description. But you could use a named Mutex. So you could get access to this Mutex. The Mutex can just be freed by the thread owning it. Is this the thing you mean with no direct access?
Sorry, by No direct access i meant no refference to the object. It's internal to a class in a 3rd party lib library. I've succeeded in avoiding the issue with a retry loop and Thread.Sleep().
------------------------------- Carrier Bags - 21st Century Tumbleweed.