Code example for SynchronousQueue

0
    private static final String LOGTAG = "GfxInfoThread";
 
    private SynchronousQueue<String> mDataQueue;
 
    public GfxInfoThread() { 
        mDataQueue = new SynchronousQueue<String>();
    } 
 
    private void error(String msg) {
        Log.e(LOGTAG, msg);
        try { 
            mDataQueue.put("ERROR\n" + msg + "\n");
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        } 
    } 
 
    private void eglError(EGL10 egl, String msg) {
        error(msg + " (EGL error " + Integer.toHexString(egl.eglGetError()) + ")");
    }