public void Add(AMD_Hello_sayHello cb, int delay) { lock (this) { if (!_done) { // // Add the work item. // CallbackEntry entry = new CallbackEntry(); entry.cb = cb; entry.delay = delay; if (_callbacks.Count == 0) { Monitor.Pulse(this); } _callbacks.Add(entry); } else { // // Destroyed, throw exception. // cb.ice_exception(new RequestCanceledException()); } } }
public void Add(AMD_Hello_sayHello cb, int delay) { lock(this) { if(!_done) { // // Add the work item. // CallbackEntry entry = new CallbackEntry(); entry.cb = cb; entry.delay = delay; if(_callbacks.Count == 0) { Monitor.Pulse(this); } _callbacks.Add(entry); } else { // // Destroyed, throw exception. // cb.ice_exception(new RequestCanceledException()); } } }
public override void sayHello_async(AMD_Hello_sayHello cb, int delay, Ice.Current current) { if(delay == 0) { Console.Out.WriteLine("Hello World!"); cb.ice_response(); } else { _workQueue.Add(cb, delay); } }
public override void sayHello_async(AMD_Hello_sayHello cb, int delay, Ice.Current current) { if (delay == 0) { Console.Out.WriteLine("Hello World!"); cb.ice_response(); } else { _workQueue.Add(cb, delay); } }
public void Add(AMD_Hello_sayHello cb, int delay) { #if COMPACT _m.Lock(); try #else lock(this) #endif { if(!_done) { // // Add the work item. // CallbackEntry entry = new CallbackEntry(); entry.cb = cb; entry.delay = delay; if(_callbacks.Count == 0) { #if COMPACT _m.Notify(); #else Monitor.Pulse(this); #endif } _callbacks.Add(entry); } else { // // Destroyed, throw exception. // cb.ice_exception(new RequestCanceledException()); } } #if COMPACT finally { _m.Unlock(); } #endif }
public void Add(AMD_Hello_sayHello cb, int delay) { #if COMPACT _m.Lock(); try #else lock (this) #endif { if (!_done) { // // Add the work item. // CallbackEntry entry = new CallbackEntry(); entry.cb = cb; entry.delay = delay; if (_callbacks.Count == 0) { #if COMPACT _m.Notify(); #else Monitor.Pulse(this); #endif } _callbacks.Add(entry); } else { // // Destroyed, throw exception. // cb.ice_exception(new RequestCanceledException()); } } #if COMPACT finally { _m.Unlock(); } #endif }