VoiceRoomThreadManager.java
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.chudiangameplay.android.manager;
import com.chudiangameplay.android.MyApplication;
import com.chudiangameplay.android.model.CurrentUserSettings;
import com.chudiangameplay.android.model.WorkerThread;
/**
* Created by Administrator on 2018/8/20.
*/
public class VoiceRoomThreadManager {
private static WorkerThread mWorkerThread;
public static synchronized void initWorkerThread() {
if (mWorkerThread == null) {
mWorkerThread = new WorkerThread(MyApplication.context);
mWorkerThread.start();
mWorkerThread.waitForReady();
}
}
public static synchronized WorkerThread getWorkerThread() {
return mWorkerThread;
}
public static synchronized void deInitWorkerThread() {
mWorkerThread.exit();
try {
mWorkerThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
mWorkerThread = null;
}
public static final CurrentUserSettings mAudioSettings = new CurrentUserSettings();
}