• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question about thread? Can you help me?

 
Kenny Smith
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the statement right:
If you call the sleep() on the Thread class, the current-executing thread gives up the locks it has.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you bothered looking up the javadoc?
- Peter
[ January 08, 2002: Message edited by: Peter den Haan ]
 
Laudney Ren
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the j2se 1.3 API, both of the two sleep methods:
public static void sleep (long millis)
public static void sleep (long millis, int nanos)
do not lose ownership of any monitors.
 
Kenny Smith
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see and thanks all of you guys!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic