擅长:python、mysql、java
<p>这是用<code>Condition</code>对象完成的</p>
<pre><code>self.conditon = threading.Condition()
</code></pre>
<p>对于等待超时或脉冲,请执行以下操作:</p>
<pre><code>with service.conditon:
service.conditon.wait(5)
</code></pre>
<p>通知:</p>
<pre><code>with self.conditon:
self.conditon.notifyAll()
</code></pre>