<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">class </span><ahref="index.html">Mutable</a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">locked<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a><spanclass="token operator"> = </span><spanclass="token boolean">false</span></span></span><spanclass="token punctuation">)</span> : <ahref="../index.html">SmartMutex</a></div><pclass="paragraph">Mutable variant of <ahref="../index.html">SmartMutex</a>. With that variant you may <ahref="lock.html">lock</a> and <ahref="unlock.html">unlock</a>. Besides, you may create <ahref="../-immutable/index.html">Immutable</a> variant of this instance with <ahref="immutable.html">immutable</a> factory</p><h4class="">Parameters</h4><divclass="table"><divclass="table-row"data-filterable-current=":micro_utils.dokka:dokkaHtml/commonMain"data-filterable-set=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="main-subrow keyValue "><divclass=""><spanclass="inline-flex"><div><u><span><span>locked</span></span></u></div></span></div><div><divclass="title"><pclass="paragraph">Preset state of <spandata-unresolved-link="dev.inmo.micro_utils.coroutines/SmartMutex.Mutable/isLocked/#/PointingToDeclaration/">isLocked</span> and its internal <spandata-unresolved-link="dev.inmo.micro_utils.coroutines/SmartMutex.Mutable/_lockStateFlow/#/PointingToDeclaration/">_lockStateFlow</span></p></div></div></div></div></div></div></div>
<divclass="tabs-section"tabs-section="tabs-section"><buttonclass="section-tab"data-active=""data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button><buttonclass="section-tab"data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION,EXTENSION_PROPERTY,EXTENSION_FUNCTION">Members & Extensions</button></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><ahref="lock.html"><spanclass="token function">lock</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Holds call until this <ahref="../index.html">SmartMutex</a> will be re-locked. That means that while <spandata-unresolved-link="dev.inmo.micro_utils.coroutines/SmartMutex.Mutable/isLocked/#/PointingToDeclaration/">isLocked</span> == true, holds will wait for <spandata-unresolved-link="dev.inmo.micro_utils.coroutines/SmartMutex.Mutable/isLocked/#/PointingToDeclaration/">isLocked</span> == false and then try to lock</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><ahref="unlock.html"><spanclass="token function">unlock</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></div><divclass="brief "><pclass="paragraph">If <spandata-unresolved-link="dev.inmo.micro_utils.coroutines/SmartMutex.Mutable/isLocked/#/PointingToDeclaration/">isLocked</span> == true - will change it to false and return true. If current call will not unlock this <ahref="../index.html">SmartMutex</a> - false</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><ahref="../index.html">SmartMutex</a><spanclass="token punctuation">.</span><ahref="../../wait-unlock.html"><spanclass="token function">waitUnlock</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></div><divclass="brief "><pclass="paragraph">Will wait until the <ahref="../lock-state-flow.html">SmartMutex.lockStateFlow</a> of <spandata-unresolved-link="dev.inmo.micro_utils.coroutines//&lt;this&gt;/#/PointingToCallableParameters(-1)/">this</span> instance will be false.</p></div></div></div>