由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - thread 在进入 timed_waiting 或 waiting之前是不是要释放它拥有的所有lock?
相关主题
有关thread in Java[转载] 现在还有什么OS不是THREAD级调度的吗?
Apply lock on a class.java thread question
CC150 16.6答案是不是有问题? (转载)thread independent on a single-cpu machine?
Timeout issueThread对应的input和output问题
java ,wait ,notify notifyallmulti-threading guru们 (转载)
Java synchronized method一问多少个thread 就算不正常?
A question about inheritance怎么学multithreading/concurrency?
Re: How to lock a file and detect a thread is over?one multi-threading question
相关话题的讨论汇总
话题: waiting话题: thread话题: lock话题: timed话题: method
进入Java版参与讨论
1 (共1页)
q**q
发帖数: 266
1
如题。比如一个thread用sleep进入timed_waiting或用wait,join进入waiting state之
前,它是不是要释放它所拥有的所有lock?
谢谢。
r*****l
发帖数: 2859
2
Method wait() is associated with one object. Calling this method will cause
the thread to surrender the lock of that object.

【在 q**q 的大作中提到】
: 如题。比如一个thread用sleep进入timed_waiting或用wait,join进入waiting state之
: 前,它是不是要释放它所拥有的所有lock?
: 谢谢。

q**q
发帖数: 266
3
Thanks. What about sleep? Suppose the sleep method is invoked inside a
synchronized statement

cause

【在 r*****l 的大作中提到】
: Method wait() is associated with one object. Calling this method will cause
: the thread to surrender the lock of that object.

r*****l
发帖数: 2859
4
http://docs.oracle.com/javase/6/docs/api/
One comment on that page for sleep():
"The thread does not lose ownership of any monitors."

【在 q**q 的大作中提到】
: Thanks. What about sleep? Suppose the sleep method is invoked inside a
: synchronized statement
:
: cause

q**q
发帖数: 266
5
Thank you very much! I didn't notice this.

【在 r*****l 的大作中提到】
: http://docs.oracle.com/javase/6/docs/api/
: One comment on that page for sleep():
: "The thread does not lose ownership of any monitors."

1 (共1页)
进入Java版参与讨论
相关主题
one multi-threading questionjava ,wait ,notify notifyall
Re: 同时实现的两个接口中有同名的函数怎么办?Java synchronized method一问
请教BufferedImage中的setColor问题。A question about inheritance
ant junit and log4j can't work togetherRe: How to lock a file and detect a thread is over?
有关thread in Java[转载] 现在还有什么OS不是THREAD级调度的吗?
Apply lock on a class.java thread question
CC150 16.6答案是不是有问题? (转载)thread independent on a single-cpu machine?
Timeout issueThread对应的input和output问题
相关话题的讨论汇总
话题: waiting话题: thread话题: lock话题: timed话题: method