Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Threads
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Threads and Synchronization
Why are sleep(), yield() and interrupted() static?
matt love
Ranch Hand
Posts: 67
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It seems to me more intuitive to think of each as instance methods.
Thanks.
Matt
Jeff Verdegan
Bartender
Posts: 6109
6
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Because they apply to the current
thread
. Certainly you wouldn't want just any thread to call sleep() or yield() on your thread. And you probably wouldn't want another thread to be able to clear your current thread's interrupted flag.
matt love
Ranch Hand
Posts: 67
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Jeff.
Makes terrific sense.
Matt
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Thread methods- Am I missing something?
Sleep and yield methods
Sleep and Yield.. Am i correct??
Interrupt, Interrupted and isInterrupted
Thread
More...