Пример #1
0
 public void Unref()
 {
     if (RefCount <= 0)
     {
         return;
     }
     if (RefCount == 1)
     {
         async.Unref();
     }
     RefCount--;
 }
Пример #2
0
        internal Loop(IntPtr handle, ByteBufferAllocatorBase allocator)
        {
            NativeHandle        = handle;
            ByteBufferAllocator = allocator;

            callback = new AsyncCallback(this);
            async    = new Async(this);

            // this fixes a strange bug, where you can't send async
            // stuff from other threads
            Sync(() => { });
            async.Send();
            RunOnce();

            // ignore our allocated resources
            async.Unref();
            callback.Unref();
        }
Пример #3
0
        internal Loop(IntPtr handle, ByteBufferAllocatorBase allocator)
        {
            NativeHandle = handle;
            ByteBufferAllocator = allocator;

            callback = new AsyncCallback(this);
            async = new Async(this);

            // this fixes a strange bug, where you can't send async
            // stuff from other threads
            Sync(() => { });
            async.Send();
            RunOnce();

            // ignore our allocated resources
            async.Unref();
            callback.Unref();
        }
Пример #4
0
        internal Loop(IntPtr handle)
        {
            Handle = handle;

            var that = this;
            callback = new AsyncCallback(this);
            async = new Async(this);

            // this fixes a strange bug, where you can't send async
            // stuff from other threads
            Sync(() => { });
            async.Send();
            RunOnce();

            // ignore our allocated resources
            async.Unref();
            callback.Unref();
        }
Пример #5
0
        internal Loop(IntPtr handle)
        {
            Handle = handle;

            var that = this;

            callback = new AsyncCallback(this);
            async    = new Async(this);

            // this fixes a strange bug, where you can't send async
            // stuff from other threads
            Sync(() => { });
            async.Send();
            RunOnce();

            // ignore our allocated resources
            async.Unref();
            callback.Unref();
        }
Пример #6
0
 public void Unref()
 {
     async.Unref();
 }