I just use a simple lock to manage some common data.
Is there any way to find out which thread took the lock?
Basically, someone already acquired the lock and did not release it. Thus, all subsequent operations simply hit on locking and timing.
I kind of hit it, because it just flows from the debugger in the lock, because someone had already purchased it, and I looked at "Debugger + Windows + Threads" after "Break All" - not a single nick entered the lock.
It does not show threads that have entered the critical section.
Any help / thoughts appreciated ...
There is a chance that someone took the lock, and this thread was interrupted. But I expect the lock to be released, although the thread was interrupted. Is my expectation wrong?
Here is my class - basically its synergo cmd runner and cmds can be executed from several threads:
internal abstract class PowerShellCommandRunner : IDisposable { #region Fields protected object m_syncObject = new object(); private PSSession m_psSession = null; private Runspace m_runspace = null; #endregion #region Constructor public PowerShellCommandRunner(ExchangeApplicationSystem system) { if (null == system) { throw new ArgumentNullException("ExchangeApplicationSystem"); } this.ExchangeApplicationSystem = system; this.PSCredential = this.ExchangeApplicationSystem.Credential.GetPSCredential(); } #endregion #region Properties internal ExchangeApplicationSystem ExchangeApplicationSystem { get; private set; } public PSCredential PSCredential { get; protected set; } private bool IsNotInitializedOrInvalidRunspace(Runspace runspace) { bool flag = (null == runspace)
Regards, Dreamer
source share