Code example for HandlerThread

Methods: quit

0
            mEgl.eglTerminate(mEglDisplay);
            mEglSurface = null;
            mEglContext = null;
            mEglDisplay = null;
            releaseSurfaceTexture(mInputSurfaceTexture);
            mEglThread.quit();
        } 
 
        @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
        private void releaseSurfaceTexture(SurfaceTexture st) {
            if (ApiHelper.HAS_RELEASE_SURFACE_TEXTURE) { 
                st.release();
            } 
        } 
 
        // Should be called from other thread. 
        public void sendMessageSync(int msg) {
            mEglThreadBlockVar.close();
            sendEmptyMessage(msg);
            mEglThreadBlockVar.block();
        }