##// END OF EJS Templates
Добавлена метка v3.0.16 для набора изменений 00a2d52813ee
Добавлена метка v3.0.16 для набора изменений 00a2d52813ee

File last commit:

r295:28af686e24f7 default
r298:a7c3390f6ac8 default
Show More
Signal.cs
30 lines | 723 B | text/x-csharp | CSharpLexer
cin
Fixed promise rejection when there is not specified error handler in the reaction....
r295 using System.Threading;
cin
Added tests for Implab.ServiceHost.Unity configuration loader.
r289
namespace Implab.Parallels {
/// <summary>
/// Implements a simple signalling logic using <see cref="Monitor.PulseAll(object)"/>.
/// </summary>
public class Signal {
readonly object m_lock = new object();
bool m_state;
public void Set() {
lock(m_lock) {
m_state = true;
Monitor.PulseAll(m_lock);
}
}
public void Wait() {
lock (m_lock)
if (!m_state)
Monitor.Wait(m_lock);
}
public bool Wait(int timeout) {
lock (m_lock)
return m_state || Monitor.Wait(m_lock, timeout);
}
}
}