Code example for HashSet

Methods: add, size

0
mTimerWakeLock.acquire(timeout);
    } 
 
    synchronized void acquire(Object holder) {
        mHolders.add(holder);
        if (mWakeLock == null) {
            mWakeLock = mPowerManager.newWakeLock(
                    PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock");
        } 
        if (!mWakeLock.isHeld()) mWakeLock.acquire();
        if (DEBUGV) Log.v(TAG, "acquire wakelock: holder count="
                + mHolders.size());
    } 
 
    synchronized void release(Object holder) {
        mHolders.remove(holder);
        if ((mWakeLock != null) && mHolders.isEmpty()
                && mWakeLock.isHeld()) {
            mWakeLock.release();
        }