Example usage for java.lang Runnable notify

List of usage examples for java.lang Runnable notify

Introduction

In this page you can find the example usage for java.lang Runnable notify.

Prototype

@HotSpotIntrinsicCandidate
public final native void notify();

Source Link

Document

Wakes up a single thread that is waiting on this object's monitor.

Usage

From source file:com.ab.bitmap.AbImageCache.java

/**
 * ??./* w  w  w. j av a2 s .c  om*/
 *
 * @param key  urlkey
 */
public static void removeWaitRunnableFromCache(String key) {
    try {
        lock.lock();
        for (int i = 0; i < waitRunnableList.size(); i++) {
            HashMap<String, Runnable> runnableMap = waitRunnableList.get(i);
            Runnable runnable = runnableMap.get(key);
            if (runnable != null) {
                //if(D) Log.d(TAG, ":"+runnable);
                synchronized (runnable) {
                    runnable.notify();
                }
                waitRunnableList.remove(runnableMap);
                i--;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        lock.unlock();
    }
}

From source file:com.inter.trade.view.slideplayview.AbImageCache.java

/**
 * ??./*from  ww  w .ja v a2s.c o  m*/
 *
 * @param key  urlkey
 */
public static void removeWaitRunnableFromCache(String key) {
    try {
        lock.lock();
        for (int i = 0; i < waitRunnableList.size(); i++) {
            HashMap<String, Runnable> runnableMap = waitRunnableList.get(i);
            Runnable runnable = runnableMap.get(key);
            if (runnable != null) {
                if (D)
                    Log.d(TAG, ":" + runnable);
                synchronized (runnable) {
                    runnable.notify();
                }
                waitRunnableList.remove(runnableMap);
                i--;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        lock.unlock();
    }
}