void shutdown() { statsThread.quit(); }
/** * Releases the helper. Should be called when the helper is no longer required. */ public void release() { handlerThread.quit(); }
public void release() { thread.quit(); } }
/** Releases the runner. Should be called when the runner is no longer required. */ public void release() { playbackThread.quit(); }
/** * Call from camera thread. */ private void quit() { synchronized (LOCK) { this.thread.quit(); this.thread = null; this.handler = null; } }
public void stopPauseAllLooperCheck() { pauseAllHandler.removeMessages(PAUSE_ALL_CHECKER_WHAT); pauseAllChecker.quit(); }
void discardAllMessage() { if (handler != null) { handler.removeCallbacksAndMessages(null); handlerThread.quit(); parkThread = Thread.currentThread(); while (handlingMessage) { LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(100)); } parkThread = null; } }
/** Releases the runner. Should be called when the runner is no longer required. */ public void release() { playbackThread.quit(); }
public void release() { thread.quit(); } }
/** * Stop decoding. * * This must be called from the UI thread. */ public void stop() { Util.validateMainThread(); synchronized (LOCK) { running = false; handler.removeCallbacksAndMessages(null); thread.quit(); } }
@Override protected void onDestroy() { super.onDestroy(); Api.get(this).unregisterSearchListener(queryListener); if (backgroundThumbnailFetcher != null) { backgroundThumbnailFetcher.cancel(); backgroundThumbnailFetcher = null; backgroundThread.quit(); backgroundThread = null; } }
private void releaseInternal() { resetInternal( /* releaseMediaSource= */ true, /* resetPosition= */ true, /* resetState= */ true); loadControl.onReleased(); setState(Player.STATE_IDLE); internalPlaybackThread.quit(); synchronized (this) { released = true; notifyAll(); } }
private synchronized void stopDraw() { if (handler != null) { handler.quit(); handler = null; } HandlerThread handlerThread = this.mHandlerThread; mHandlerThread = null; if (handlerThread != null) { try { handlerThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } handlerThread.quit(); } }
/** * Stops all of the tasks and releases resources. If the action file isn't up to date, waits for * the changes to be written. The manager must not be accessed after this method has been called. */ public void release() { if (released) { return; } released = true; for (int i = 0; i < tasks.size(); i++) { tasks.get(i).stop(); } final ConditionVariable fileIOFinishedCondition = new ConditionVariable(); fileIOHandler.post(fileIOFinishedCondition::open); fileIOFinishedCondition.block(); fileIOThread.quit(); logd("Released"); }
private synchronized void stopDraw() { if (handler != null) { handler.quit(); handler = null; } HandlerThread handlerThread = this.mHandlerThread; mHandlerThread = null; if (handlerThread != null) { try { handlerThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } handlerThread.quit(); } }
@WorkerThread @Override public void run() { LogManager.d(TAG, "Quitting scan thread"); mScanThread.quit(); } });
private void release() throws InterruptedException { handler.post( () -> { try { if (player != null) { player.release(); } } catch (Exception e) { handleException(e); } finally { playerThread.quit(); } }); playerThread.join(); }
@After public void tearDown() throws Exception { // Try to ensure we've exited the thread at the end of each test if ( handlerThread != null ) { handlerThread.quit(); handlerThread.join(); } }
private void release() throws InterruptedException { handler.post( () -> { try { if (player != null) { player.release(); } } catch (Exception e) { handleException(e); } finally { playerThread.quit(); } }); playerThread.join(); }
@Test public void shouldQuitLooperAndThread() throws Exception { handlerThread = new HandlerThread("test"); Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler()); handlerThread.setUncaughtExceptionHandler(new MyUncaughtExceptionHandler()); handlerThread.start(); assertTrue(handlerThread.isAlive()); assertTrue(handlerThread.quit()); handlerThread.join(); assertFalse(handlerThread.isAlive()); handlerThread = null; }