Code example for LinkedBlockingQueue

Methods: clear

0
    } 
 
    public void stop() { 
        mIsStopped = true;
        mWorker.interrupt();
        mTasks.clear();
    } 
 
    public boolean remove(Executable<Result> task) {
        if (mIsStopped) {
            return false; 
        } 
        return mTasks.remove(task);
    } 
 
    public boolean add(Executable<Result> task) {
        if (mIsStopped) {
            return false; 
        } 
        synchronized (mEmptyLock) {
            boolean result = mTasks.add(task);