Skip to content

Commit 7a9d373

Browse files
authored
Make fields volatile for thread safety
1 parent efb2ebf commit 7a9d373

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/java/org/nanohttpd/protocols/http/ServerRunnable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
*/
4545
public class ServerRunnable implements Runnable {
4646

47-
private NanoHTTPD httpd;
47+
private final NanoHTTPD httpd;
4848

4949
private final int timeout;
5050

51-
private IOException bindException;
51+
private volatile IOException bindException;
5252

53-
private boolean hasBinded = false;
53+
private volatile boolean hasBinded = false;
5454

5555
public ServerRunnable(NanoHTTPD httpd, int timeout) {
5656
this.httpd = httpd;

0 commit comments

Comments
 (0)