This commit is contained in:
InsanusMokrassar
2025-03-25 12:14:11 +00:00
parent 03f2dcd159
commit bb95c36b62
6612 changed files with 11003 additions and 6896 deletions

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>Smart</span><wbr></wbr><span><span>RWLocker</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">readPermits<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html">Int</a><span class="token operator"> = </span>Int.MAX_VALUE<span class="token punctuation">, </span></span><span class="parameter ">writeIsLocked<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">false</span></span></span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L15">source</a>)</span></span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">readPermits<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html">Int</a><span class="token operator"> = </span>Int.MAX_VALUE<span class="token punctuation">, </span></span><span class="parameter ">writeIsLocked<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">false</span></span></span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L17">source</a>)</span></span></div></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>acquire</span><wbr></wbr><span><span>Read</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="acquire-read.html"><span class="token function">acquireRead</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L25">source</a>)</span></span></div><p class="paragraph">Do lock in <a href="read-semaphore.html">readSemaphore</a> inside of <a href="write-mutex.html">writeMutex</a> locking</p></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="acquire-read.html"><span class="token function">acquireRead</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L27">source</a>)</span></span></div><p class="paragraph">Do lock in <a href="read-semaphore.html">readSemaphore</a> inside of <a href="write-mutex.html">writeMutex</a> locking</p></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -108,7 +108,7 @@
<div class="breadcrumbs"><a href="../../../index.html">micro_utils.dokka</a><span class="delimiter">/</span><a href="../index.html">dev.inmo.micro_utils.coroutines</a><span class="delimiter">/</span><span class="current">SmartRWLocker</span></div>
<div class="cover ">
<h1 class="cover"><span>Smart</span><wbr></wbr><span><span>RWLocker</span></span></h1>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">class </span><a href="index.html">SmartRWLocker</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">readPermits<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html">Int</a><span class="token operator"> = </span>Int.MAX_VALUE<span class="token punctuation">, </span></span><span class="parameter ">writeIsLocked<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">false</span></span></span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L15">source</a>)</span></span></div><p class="paragraph">Composite mutex which works with next rules:</p><ul><li><p class="paragraph"><a href="acquire-read.html">acquireRead</a> require to <a href="write-mutex.html">writeMutex</a> be free. Then it will take one lock from <a href="read-semaphore.html">readSemaphore</a></p></li><li><p class="paragraph"><a href="release-read.html">releaseRead</a> will just free up one permit in <a href="read-semaphore.html">readSemaphore</a></p></li><li><p class="paragraph"><a href="lock-write.html">lockWrite</a> will lock <a href="write-mutex.html">writeMutex</a> and then await while all <a href="read-semaphore.html">readSemaphore</a> will be freed</p></li><li><p class="paragraph"><a href="unlock-write.html">unlockWrite</a> will just unlock <a href="write-mutex.html">writeMutex</a></p></li></ul></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">class </span><a href="index.html">SmartRWLocker</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">readPermits<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html">Int</a><span class="token operator"> = </span>Int.MAX_VALUE<span class="token punctuation">, </span></span><span class="parameter ">writeIsLocked<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">false</span></span></span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L17">source</a>)</span></span></div><p class="paragraph">Composite mutex which works with next rules:</p><ul><li><p class="paragraph"><a href="acquire-read.html">acquireRead</a> require to <a href="write-mutex.html">writeMutex</a> to be free. Then it will take one lock from <a href="read-semaphore.html">readSemaphore</a></p></li><li><p class="paragraph"><a href="release-read.html">releaseRead</a> will just free up one permit in <a href="read-semaphore.html">readSemaphore</a></p></li><li><p class="paragraph"><a href="lock-write.html">lockWrite</a> will lock <a href="write-mutex.html">writeMutex</a> and then await while all <a href="read-semaphore.html">readSemaphore</a> will be freed. If coroutine will be cancelled during read semaphore freeing, locking will be cancelled too with <a href="../-smart-mutex/-mutable/unlock.html">SmartMutex.Mutable.unlock</a>ing of <a href="write-mutex.html">writeMutex</a></p></li><li><p class="paragraph"><a href="unlock-write.html">unlockWrite</a> will just unlock <a href="write-mutex.html">writeMutex</a></p></li></ul></div></div>
</div>
<div class="tabbedcontent">
<div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION">Members</button><button class="section-tab" data-togglable="CONSTRUCTOR,TYPE,PROPERTY,FUNCTION,EXTENSION_PROPERTY,EXTENSION_FUNCTION">Members &amp; Extensions</button></div>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>lock</span><wbr></wbr><span><span>Write</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="lock-write.html"><span class="token function">lockWrite</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L40">source</a>)</span></span></div><p class="paragraph">Locking <a href="write-mutex.html">writeMutex</a> and wait while all <a href="read-semaphore.html">readSemaphore</a> permits will be freed</p></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="lock-write.html"><span class="token function">lockWrite</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L42">source</a>)</span></span></div><p class="paragraph">Locking <a href="write-mutex.html">writeMutex</a> and wait while all <a href="read-semaphore.html">readSemaphore</a> permits will be freed</p></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>read</span><wbr></wbr><span><span>Semaphore</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">val </span><a href="read-semaphore.html">readSemaphore</a><span class="token operator">: </span><a href="../-smart-semaphore/-immutable/index.html">SmartSemaphore.Immutable</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L19">source</a>)</span></span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">val </span><a href="read-semaphore.html">readSemaphore</a><span class="token operator">: </span><a href="../-smart-semaphore/-immutable/index.html">SmartSemaphore.Immutable</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L21">source</a>)</span></span></div></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>release</span><wbr></wbr><span><span>Read</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="release-read.html"><span class="token function">releaseRead</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L33">source</a>)</span></span></div><p class="paragraph">Release one read permit in <a href="read-semaphore.html">readSemaphore</a></p></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="release-read.html"><span class="token function">releaseRead</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L35">source</a>)</span></span></div><p class="paragraph">Release one read permit in <a href="read-semaphore.html">readSemaphore</a></p></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>unlock</span><wbr></wbr><span><span>Write</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="unlock-write.html"><span class="token function">unlockWrite</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L48">source</a>)</span></span></div><p class="paragraph">Unlock <a href="write-mutex.html">writeMutex</a></p></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">suspend </span><span class="token keyword">fun </span><a href="unlock-write.html"><span class="token function">unlockWrite</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html">Boolean</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L55">source</a>)</span></span></div><p class="paragraph">Unlock <a href="write-mutex.html">writeMutex</a></p></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>

View File

@@ -46,7 +46,7 @@
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
0.25.2 </div>
0.25.3 </div>
<div class="navigation-controls">
<div class="filter-section filter-section_loading" id="filter-section">
<button class="platform-tag platform-selector common-like" data-active=""
@@ -109,7 +109,7 @@
<div class="cover ">
<h1 class="cover"><span>write</span><wbr></wbr><span><span>Mutex</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">val </span><a href="write-mutex.html">writeMutex</a><span class="token operator">: </span><a href="../-smart-mutex/-immutable/index.html">SmartMutex.Immutable</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L20">source</a>)</span></span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":micro_utils.dokka:dokkaHtml/commonMain"><div class="symbol monospace"><span class="token keyword">val </span><a href="write-mutex.html">writeMutex</a><span class="token operator">: </span><a href="../-smart-mutex/-immutable/index.html">SmartMutex.Immutable</a><span class="clearfix"><span class="floating-right">(<a href="https://github.com/InsanusMokrassar/MicroUtils/blob/master//coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt#L22">source</a>)</span></span></div></div></div>
</div>
<div class="footer">
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>