mirror of
https://github.com/revanced/jadb.git
synced 2025-05-18 15:07:06 +02:00
Refactor: Better names
- serverReady and waitForServer had inverted names for some reason.
This commit is contained in:
parent
2073817c95
commit
24348f806d
@ -22,7 +22,7 @@ public abstract class SocketServer implements Runnable {
|
||||
thread = new Thread(this, "Fake Adb Server");
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
serverReady();
|
||||
waitForServer();
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
@ -35,7 +35,7 @@ public abstract class SocketServer implements Runnable {
|
||||
socket = new ServerSocket(port);
|
||||
socket.setReuseAddress(true);
|
||||
|
||||
waitForServer();
|
||||
serverReady();
|
||||
|
||||
while (true) {
|
||||
Socket c = socket.accept();
|
||||
@ -47,7 +47,14 @@ public abstract class SocketServer implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void serverReady() throws InterruptedException {
|
||||
private void serverReady() {
|
||||
synchronized (lockObject) {
|
||||
isStarted = true;
|
||||
lockObject.notify();
|
||||
}
|
||||
}
|
||||
|
||||
private void waitForServer() throws InterruptedException {
|
||||
synchronized (lockObject) {
|
||||
if (!isStarted) {
|
||||
lockObject.wait();
|
||||
@ -55,13 +62,6 @@ public abstract class SocketServer implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void waitForServer() {
|
||||
synchronized (lockObject) {
|
||||
lockObject.notify();
|
||||
isStarted = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Runnable createResponder(Socket socket);
|
||||
|
||||
public void stop() throws IOException, InterruptedException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user