J
Josh G
Is java ignoring my synchronized keyword or do I have a wrong idea as to
what it should do? I have a method looking somewhat like this:
synchronized void dostuff() {
System.out.println("");
System.out.println("********************************* Starting dostuff
for " + myname);
//Does stuff in here...
System.out.println("********************************* ending dostuff
for " + myname);
System.out.println("");
}
Anyway the method is synchronized, but it's being entered multiple times
by the various threads I create. What am I doing wrong?
Cheers,
-Josh G
what it should do? I have a method looking somewhat like this:
synchronized void dostuff() {
System.out.println("");
System.out.println("********************************* Starting dostuff
for " + myname);
//Does stuff in here...
System.out.println("********************************* ending dostuff
for " + myname);
System.out.println("");
}
Anyway the method is synchronized, but it's being entered multiple times
by the various threads I create. What am I doing wrong?
Cheers,
-Josh G