protected CoroutineMonitorConcurrent MakeInnerConcurrent() { var con = _Inner as CoroutineMonitorConcurrent; if (con == null) { con = new CoroutineMonitorConcurrent(); con.AddWork(_Inner); _Inner = con; } return(con); }
public void ConcurrentLast(IEnumerator work) { if (work == null) { return; } var realwork = GetRealWorkFromSubWork(work); if (_Inner == null) { _Inner = realwork; } else { var queue = _Inner as CoroutineWorkQueue; if (queue == null) { var queuec = MakeInnerConcurrent(); queuec.AddWork(realwork); } else { var last = queue.LastWork; if (last == null) { queue.AddWork(realwork); } else { var queuec = last as CoroutineMonitorConcurrent; if (queuec != null) { queuec.AddWork(realwork); } else { queuec = new CoroutineMonitorConcurrent(); queuec.AddWork(last); queuec.AddWork(realwork); } } } } }