Skip to content

Instantly share code, notes, and snippets.

View vinaymcu's full-sized avatar

vinaymcu

  • delhi
View GitHub Profile
@vinaymcu
vinaymcu / code
Created August 24, 2016 04:46
code
class Shared {
synchronized void methodOne(Shared s) {
Thread t = Thread.currentThread();
System.out.println(t.getName() + "is executing methodOne...");
System.out.println(t.getName() + "is calling methodTwo...");
s.methodTwo(this);
System.out.println(t.getName() + "is finished executing methodOne...");
}