<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="-smart-semaphore/index.html">SmartSemaphore</a><spanclass="token punctuation">.</span><ahref="wait-release.html"><spanclass="token function">waitRelease</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">permits<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span><spanclass="token constant">1</span></span></span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="clearfix"><spanclass="floating-right">(<ahref="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartSemaphore.kt#L168">source</a>)</span></span></div><pclass="paragraph">Will wait until the <ahref="-smart-semaphore/permits-state-flow.html">SmartSemaphore.permitsStateFlow</a> of <spandata-unresolved-link="dev.inmo.micro_utils.coroutines//&lt;this&gt;/#/PointingToCallableParameters(-1)/">this</span> instance will have <ahref="wait-release.html">permits</a> count free permits.</p><pclass="paragraph">Anyway, after the end of this block there are no any guaranties that <ahref="-smart-semaphore/free-permits.html">SmartSemaphore.freePermits</a>>= <ahref="wait-release.html">permits</a> due to the fact that some other parties may lock it again</p></div></div>