Code example for ArrayBlockingQueue

Methods: take

0
    } 
 
    public synchronized int take() { 
        try { 
            // Will block until one becomes available 
            return (int)mTextureIds.take();
        } catch (InterruptedException e) {
            return 0; 
        } 
    } 
 
    public synchronized void fill() { 
        EGL10 egl = (EGL10)EGLContext.getEGL();
        EGLContext context = egl.eglGetCurrentContext();
 
        if (mContext != null && mContext != context) {
            mTextureIds.clear();
        } 
 
        mContext = context;