@Override public void run() { int res = 0; while (true) { if (mBreakout) { Log.e(TAG, "Breaking out"); break; } res = dowork(); if ((res & UPDATED_DEPTH) != 0) depthReceiver.DepthCallback(); if ((res & UPDATED_ODOM) != 0) vioReceiver.VIOCallback(); try { Thread.sleep(33); } catch (InterruptedException e) { Log.e(TAG, "INSOMNIA", e); } } Log.e(TAG, "Broke out"); }