Re: Thread executing in CS got swapped out, What happens then?
Friday, August 17, 2001 01:34 AM
Yes it's true that "A swapped out thread can still hold a lock on an object...".
This is what synchronization is all about. Once the lock is is fetched, no other thread can grab the lock until the first thread releases the lock. This has nothing to do with the priority of the threads.
If you want to read more, I can strongly recommend a book about threading: JAVA Threads by Scott Oaks & Henry Wong