74 |
|
|
75 |
|
The {@link java.util.concurrent.TimeUnit} class provides multiple |
76 |
|
granularities (including nanoseconds) for specifying and controlling |
77 |
< |
time-out based operations. Most classes in the package contain |
77 |
> |
time-out based operations. Most classes in the package contain |
78 |
|
operations based on time-outs in addition to indefinite waits. In all |
79 |
|
cases that time-outs are used, the time-out specifies the minimum time |
80 |
|
that the method should wait before indicating that it |
81 |
< |
timed-out. Implementations make a "best effort" to detect |
82 |
< |
time-outs as soon as possible after they occur. However, an indefinite |
81 |
> |
timed-out. Implementations make a "best effort" to detect |
82 |
> |
time-outs as soon as possible after they occur. However, an indefinite |
83 |
|
amount of time may elapse between a time-out being detected and a |
84 |
< |
thread actually executing again after that time-out. All methods |
84 |
> |
thread actually executing again after that time-out. All methods |
85 |
|
that accept timeout parameters treat values less than or equal to |
86 |
< |
zero to mean not to wait at all. To wait "forever", you can use |
86 |
> |
zero to mean not to wait at all. To wait "forever", you can use |
87 |
|
a value of <tt>Long.MAX_VALUE</tt>. |
88 |
|
|
89 |
|
<h2>Synchronizers</h2> |
155 |
|
<li>Each action in a thread happens before every action in that |
156 |
|
thread that comes later in the program's order. |
157 |
|
|
158 |
< |
<li>An unlock (<tt>synchronized</tt> block or method exit) on a |
158 |
> |
<li>An unlock (<tt>synchronized</tt> block or method exit) of a |
159 |
|
monitor happens before every subsequent lock (<tt>synchronized</tt> |
160 |
|
block or method entry) of that same monitor. And because |
161 |
|
the <i>happens-before</i> relation is transitive, all actions |