예제 #1
0
 private void init(shared_strand strand)
 {
     _strand    = strand;
     _waitQueue = new LinkedList <wait_node>();
     _lockID    = 0;
     _recCount  = 0;
 }
예제 #2
0
        static public void last_tick(Action action)
        {
            shared_strand currStrand = running_strand();

            Debug.Assert(null != currStrand, "不正确的 last_tick 调用!");
            currStrand._readyQueue.AddLast(action);
        }
예제 #3
0
 public go_mutex(shared_strand strand)
 {
     _strand    = strand;
     _waitQueue = new LinkedList <wait_node>();
     _lockID    = 0;
     _recCount  = 0;
     _mustTick  = false;
 }
예제 #4
0
 public async_timer(shared_strand strand, bool utcMode = false)
 {
     _strand     = strand;
     _timerCount = 0;
     _beginTick  = 0;
     _isInterval = false;
     _onTopCall  = false;
     _utcMode    = utcMode;
 }
예제 #5
0
 public steady_timer(shared_strand strand, bool utcMode)
 {
     _utcMode    = utcMode;
     _timerCount = 0;
     _looping    = false;
     _expireTime = long.MaxValue;
     _strand     = strand;
     _timerQueue = new Map <long, async_timer>(true);
 }
예제 #6
0
 public async_timer(shared_strand strand)
 {
     _strand      = strand;
     _timer       = null;
     _lastTimeout = 0;
     _timerCount  = 0;
     _beginTick   = 0;
     _isInterval  = false;
     _onTopCall   = false;
 }
예제 #7
0
 public go_condition_variable(shared_strand strand)
 {
     _strand    = strand;
     _waitQueue = new LinkedList <tuple <long, go_mutex, Action> >();
     _mustTick  = false;
 }
예제 #8
0
 public go_shared_mutex(shared_strand strand) : base(strand)
 {
     _waitQueue = new LinkedList <wait_node>();
     _sharedMap = new Dictionary <long, shared_count>();
 }
예제 #9
0
 private void init(shared_strand strand)
 {
     _strand    = strand;
     _waitQueue = new LinkedList <functional.func>();
 }
예제 #10
0
        public condition_variable()
        {
            shared_strand strand = generator.self_strand();

            init(null != strand ? strand : new shared_strand());
        }
예제 #11
0
 public condition_variable(shared_strand strand)
 {
     _strand    = strand;
     _waitQueue = new LinkedList <functional.func>();
 }
예제 #12
0
        public mutex()
        {
            shared_strand strand = generator.self_strand();

            init(null != strand ? strand : new shared_strand());
        }
예제 #13
0
 public mutex(shared_strand strand)
 {
     init(strand);
 }
예제 #14
0
 private void init(shared_strand strand)
 {
     _upgradeMutex = new mutex(strand);
     _waitQueue    = new LinkedList <wait_node>();
     _sharedMap    = new SortedList <long, shared_count>();
 }