APISonar


java.util.ArrayList.notifyAll

> java > util > ArrayList > notifyAll
java APIs util APIs ArrayList APIs notifyAll APIs

Example 1
private final ArrayList<ByteBuffer> mEmptyBuffers = new ArrayList<>();

    private void returnEmptyBufferAndNotify(boolean inputEOS) {
        synchronized (mEmptyBuffers) {
            mInputEOS |= inputEOS;
            mEmptyBuffers.add(mCurrentBuffer);
            mEmptyBuffers.notifyAll();
        }
        mCurrentBuffer = null;
    }
Example 2
private final ArrayList<ByteBuffer> mEmptyBuffers = new ArrayList<>();

    public void close() {
        // unblock the addBuffer() if we're tearing down before EOS is sent.
        synchronized (mEmptyBuffers) {
            mInputEOS = true;
            mEmptyBuffers.notifyAll();
        }

        mHandler.postAtFrontOfQueue(new Runnable() {
            @Override
            public void run() {
                stopInternal();
            }
        });
    }
Example 3
ArrayList<PrintWriter> writers = null;

  private static void closeAndClear(List<PrintWriter> writers) {
    for (PrintWriter out : writers) {
      out.close();
    }
    // By clearning the writers and notify the thread waiting on it, 
    // we will prevent JobHistory.moveToDone() from
    // waiting on writer
    synchronized (writers) {
      writers.clear();
      writers.notifyAll();
    }
  }
Example 4
private final ArrayList<Task> mTasks = new ArrayList<>(16);

	public void add(Task task) {

		synchronized(mTasks) {
			mTasks.add(task);
			mTasks.notifyAll();

			if(mIdleThreads < 1 && mRunningThreads < mMaxThreads) {
				mRunningThreads++;
				new Thread(mExecutor, mThreadName + " " + (mThreadNameCount++)).start();
			}
		}
	}
Example 5
private ArrayList<Browser> pool;

    public static void release(Browser browser) {
        BrowserPool pool = getInstance();
        //synchronized to ensure thread-safety
        synchronized (pool) {
            browser.isInUse = false;
            pool.notifyAll();
        }
    }