コード例 #1
0
 private void DoResourceAction(IExecutive exec, object obj)
 {
     m_resultString += ("[" + this.Name + ",Req," + getExecNow(exec) + "," + m_irr.Priority + "]\r\n");
     Console.WriteLine("At time " + getExecNow(exec) + ", " + m_name + " trying to acquire with a priority of " + m_irr.Priority);
     m_irr.Acquire(m_irr.DefaultResourceManager, true);
     m_resultString += ("[" + this.Name + ",Acq," + getExecNow(exec) + "]\r\n");
     Console.WriteLine("At time " + getExecNow(exec) + ", " + m_name + " acquired...");
     exec.CurrentEventController.SuspendUntil(exec.Now + TimeSpan.FromMinutes(5.0));
     Console.WriteLine("At time " + getExecNow(exec) + ", " + m_name + " releasing...");
     m_resultString += ("[" + this.Name + ",Rls," + getExecNow(exec) + "]\r\n");
     m_irr.Release();
     Console.WriteLine("...and release is done.");
 }
コード例 #2
0
 public static void PushToPool(IResourceRequest req)
 {
     req.Release();
 }
コード例 #3
0
 private void ReleaseResource(IExecutive exec, object userData)
 {
     Console.WriteLine("Releasing the resource at " + getExecNow(exec));
     m_rscReq.Release();
 }