Suppose I\'m executing a synchronized
block of code inside some thread and within the synchronized
block I call a method that spawns another thread to
If someMethod() is invoked first, its the classical example of a deadlock.
Is what I have written even legal?
---- Yes it is perfectly legal syntactically.
So when I execute someOtherMethod() in order to create an instance of Runnable in what kind of scope does the code before the return statement run? ----If the someOtherMethod() is invoked from within someMethod() then its in scope of the synchronized block of the someMethod() method.