<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'kwargs=<dict>'</span></code> to pass keyword arguments to the function.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'daemon=True'</span></code>, or the program will not be able to exit while the thread is alive.</strong></li>
<div><h3id="lock">Lock</h3><pre><codeclass="python language-python hljs"><lock> = RLock()<spanclass="hljs-comment"># Lock that can only be released by the owner.</span>
<lock>.acquire() <spanclass="hljs-comment"># Waits for lock to be available.</span>
<lock>.release() <spanclass="hljs-comment"># Makes the lock available again.</span>