Class ThreadSuspendable

    • Field Detail

      • future

        protected IFuture<?> future
        The future.
      • resumed

        protected boolean resumed
        The resumed flag to differentiante from timeout.
    • Constructor Detail

      • ThreadSuspendable

        public ThreadSuspendable()
    • Method Detail

      • suspend

        public void suspend​(Future<?> future,
                            long timeout,
                            boolean realtime)
        Suspend the execution of the suspendable.
        Specified by:
        suspend in interface ISuspendable
        Parameters:
        timeout - The timeout.
        realtime - Flag if timeout is realtime (in contrast to simulation time).
        future - The future to wait for.
      • resume

        public void resume​(Future<?> future)
        Resume the execution of the suspendable.
        Specified by:
        resume in interface ISuspendable
        Parameters:
        future - The future that issues the resume.
      • getMonitor

        public java.lang.Object getMonitor()
        Get the monitor for waiting.
        Specified by:
        getMonitor in interface ISuspendable
        Returns:
        The monitor.
      • getDefaultTimeout

        protected long getDefaultTimeout()
        Get the default timeout.
        Returns:
        The default timeout (-1 for none).