Synchronize thread extermination

Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
camera2
Leo Ma 9 years ago
parent bb6d7e00e3
commit ff98ae24c6

@ -390,6 +390,11 @@ public class RtmpConnection implements RtmpPublisher, PacketRxHandler, ThreadCon
} else if (thread instanceof WriteThread && thread.isAlive()) { } else if (thread instanceof WriteThread && thread.isAlive()) {
((WriteThread) thread).shutdown(); ((WriteThread) thread).shutdown();
} }
try {
thread.join();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
} }
} }
if (socket != null) { if (socket != null) {

Loading…
Cancel
Save