/// <summary>
        /// TimerCallback delegate for threaded timer to monitor a named process
        /// </summary>
        private async void MonitorProcess(object stateInfo)
        {// only used when initially acquiring a process
            await MonitorLock.WaitAsync();

            try
            {// monitor with a long initial timeout (for loading/updates)
                if (!TimeoutCancelled)
                {
                    await TimeoutWatcher(GlobalTimeout);
                }
                else
                {
                    MonitorTimer.Change(Timeout.Infinite, Timeout.Infinite);
                }
            }
            catch (Win32Exception) { }
            finally
            {
                MonitorLock.Release();
            }
        }
        /// <summary>
        /// TimerCallback delegate for threaded timer to reacquire a valid process by name
        /// </summary>
        private async void SearchProcess(object stateInfo)
        {// used when searching for a valid process within a timeout
            await MonitorLock.WaitAsync();

            try
            {// monitor with a shorter timeout for the search
                if (!TimeoutCancelled)
                {
                    await TimeoutWatcher(InnerTimeout);
                }
                else
                {
                    SearchTimer.Change(Timeout.Infinite, Timeout.Infinite);
                }
            }
            catch (Win32Exception) { }
            finally
            {
                MonitorLock.Release();
            }
        }
Beispiel #3
0
 public void Release(PacketFifo v)
 {
     o = v;
     thisLock.Release();
 }