void onReadingThreadFinished ( WebSocketFrame closeFrame ) { synchronized ( mThreadsLock ) { mReadingThreadFinished = true ; mServerCloseFrame = closeFrame ; if ( mWritingThreadFinished == false ) { // Wait for the writing thread to finish. return ; } } // Both the reading thread and the writing thread have finished. onThreadsFinished ( ) ; }
Called by the reading thread as its last step .