コード例 #1
0
 internal void async_lock(long id, Action ntf)
 {
     if (_strand.running_in_this_thread())
     {
         if (!_mustTick)
         {
             async_lock_(id, ntf);
         }
         else
         {
             _strand.add_last(() => async_lock_(id, ntf));
         }
     }
     else
     {
         _strand.post(() => async_lock_(id, ntf));
     }
 }
コード例 #2
0
 internal void async_wait(long id, go_mutex mutex, Action ntf)
 {
     mutex.async_unlock(id, delegate()
     {
         if (_strand.running_in_this_thread())
         {
             if (!_mustTick)
             {
                 _waitQueue.AddLast(new tuple <long, go_mutex, Action>(id, mutex, () => mutex.async_lock(id, ntf)));
             }
             else
             {
                 _strand.add_last(() => _waitQueue.AddLast(new tuple <long, go_mutex, Action>(id, mutex, () => mutex.async_lock(id, ntf))));
             }
         }
         else
         {
             _strand.post(() => _waitQueue.AddLast(new tuple <long, go_mutex, Action>(id, mutex, () => mutex.async_lock(id, ntf))));
         }
     });
 }