Browse Source

Threading

pull/83/head
Jure Šorn 3 years ago
parent
commit
d23e87f1e8
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -2060,7 +2060,7 @@ from threading import Thread, RLock, Semaphore, Event, Barrier
### Lock
```python
<lock> = RLock()
<lock> = RLock() # Lock that can only be released by the owner.
<lock>.acquire() # Waits for lock to be available.
<lock>.release() # Makes the lock available again.
```

2
index.html

@ -1832,7 +1832,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
<li><strong>Use <code class="python hljs"><span class="hljs-string">'kwargs=&lt;dict&gt;'</span></code> to pass keyword arguments to the function.</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'daemon=True'</span></code>, or the program will not be able to exit while the thread is alive.</strong></li>
</ul>
<div><h3 id="lock">Lock</h3><pre><code class="python language-python hljs">&lt;lock&gt; = RLock()
<div><h3 id="lock">Lock</h3><pre><code class="python language-python hljs">&lt;lock&gt; = RLock() <span class="hljs-comment"># Lock that can only be released by the owner.</span>
&lt;lock&gt;.acquire() <span class="hljs-comment"># Waits for lock to be available.</span>
&lt;lock&gt;.release() <span class="hljs-comment"># Makes the lock available again.</span>
</code></pre></div>

Loading…
Cancel
Save