Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5cdd627

Browse files
author
Ram swaroop
committed
made the variable volatile
1 parent a13fcc7 commit 5cdd627

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/me/ramswaroop/threads/NamePrint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class NamePrint {
1313

1414
Object lock = new Object();
15-
boolean isFirstNamePrinted = false;
15+
volatile boolean isFirstNamePrinted = false;
1616

1717
class PrintFirstName implements Runnable {
1818
@Override

0 commit comments

Comments
 (0)