This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Thread.sleep() findbug Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Thread.sleep() findbug " Watch "Thread.sleep() findbug " New topic
Author

Thread.sleep() findbug

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 327
Hi,

How to get reduce of the find bug error saying. Manual thread scheduling with Thread.sleep() or Thread.yield() has no guaranteed semantics and is often used to mask race conditions.

I just use it for sleep the current thread for a while and its not used with in a condition statement. But its used inside a junit test case which has a assert statement at the end.

Thanks.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3600
    
  14

The warning is there to draw your attention to it. If you don't want it, switch it off in your IDE.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread.sleep() findbug
 
Similar Threads
Thread.interrupt not working properly
Doubt in K&B: Threads
whethe the thread will release the lock?
question about thread output from examlab practice test 1
Threads: sleep() !