IntelliJ Java IDE
The moose likes Threads and Synchronization and the fly likes sleep Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "sleep" Watch "sleep" New topic
Author

sleep

Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
does the sleep method of class thread causes the current thread to release de lock on an object???
for example, calling sleep, will cause the current thread to release the lock on an object and then another thread will be able to get a lock on that object???
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18652
No, sleep() does not release any locks. However wait() does. See the API for more details.


"I'm not back." - Bill Harding, Twister
 
 
subject: sleep
 
Threads others viewed
Lock
how to make a thread sleep
what to answer with the yesterdays discussion on join method
Does a thread keep its locks if it goes to sleep?
Begin threds through links
developer file tools