コード例 #1
0
 internal void async_timed_wait(long id, int ms, go_mutex mutex, Action <bool> ntf)
 {
     mutex.async_unlock(id, delegate()
     {
         if (_strand.running_in_this_thread())
         {
             if (!_mustTick)
             {
                 async_timed_wait_(id, ms, mutex, ntf);
             }
             else
             {
                 _strand.add_last(() => async_timed_wait_(id, ms, mutex, ntf));
             }
         }
         else
         {
             _strand.post(() => async_timed_wait_(id, ms, mutex, 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))));
         }
     });
 }