File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes sleep() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "sleep()" Watch "sleep()" New topic
Author

sleep()

Matthew B
Greenhorn

Joined: Jul 14, 2002
Posts: 1
Will calling sleep on a thread release the threads lock an an obect/class?
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
No. See the sample code below:
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

This comes directly from the SDK. Try to read the docs, they contain the information you seek.
sleep
public static void sleep(long millis)
throws InterruptedExceptionCauses the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds. The thread does not lose ownership of any monitors.
Parameters:
millis - the length of time to sleep in milliseconds.
Throws:
InterruptedException - if another thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.
See Also:
Object.notify()
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sleep()
 
Similar Threads
violence or non-violence
Name Joke
Contacting chicken...
WA#2 word association
I dont know what is it