private void stopThreads ( long closeDelay ) { ReadingThread readingThread ; WritingThread writingThread ; synchronized ( mThreadsLock ) { readingThread = mReadingThread ; writingThread = mWritingThread ; mReadingThread = null ; mWritingThread = null ; } if ( readingThread != null ) { readingThread . requestStop ( closeDelay ) ; } if ( writingThread != null ) { writingThread . requestStop ( ) ; } }
Stop both the reading thread and the writing thread .