wood burning stoves The moose likes Programmer Certification
(SCJP/OCPJP) and the fly likes Question on Threads Big Moose
Saloon Register / Login  Bookmark "Question on Threads" Watch
"Question on Threads" New topic  Question on Threads  Arjun
Reddy Ranch Hand  Joined: Nov 10, 2007 Posts: 629 Hi All,  I am
basically creating two threads and giving both the threads, the
same job. Now in the run method, I am checking the thread name
and joining it to another thread. But I am getting errors. Can
someone tell me why? Also, since I am using a synchronized block
in the run method and since join keeps the lock, I believe even
if I succeed with the compilation process, it will cause a
deadlock. Because say if thread t1 entered the run method and I
do, t2.join, then t1 is waiting for t2 to complete but has the
lock and t2 is waiting for the lock. Am I correct? I am
providing the code.  1). Why won't the above code compile? 2).
Am I correct that if the code would have compiled, it would lead
to a deadlock? 3). How can