package com.sifang.modules.taskdispatch.util;

public class ItemTaskSignal {

    private boolean signal = false;

    public synchronized void consume() {
        while (!signal) {
            try {
                wait();
            } catch (InterruptedException e) {
                // ignore
            }
        }
        signal = false;
    }

    public synchronized void pump() {
        signal = true;
        notifyAll();
    }

}
