Exemplo n.º 1
0
    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());
            }
        }
    }
Exemplo n.º 2
0
    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());
            }
        }
    }
Exemplo n.º 3
0
 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);
        }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
    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
    }
Exemplo n.º 6
0
    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
    }