Skip to content

Commit

Permalink
deploy: 188f312
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyuu committed May 3, 2024
1 parent 7fd5084 commit 97ce8c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _sources/chapter8/0intro.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
pub condvar_list: Vec<Option<Arc<Condvar>>>, // 条件变量列表
}
在互斥锁的设计实现中,设计了一个更底层的 `UPSafeCellSafeCell<T>` 类型,用于支持在单核处理器上安全地在线程间共享可变全局变量。这个类型大致结构如下所示:
在互斥锁的设计实现中,设计了一个更底层的 `UPSafeCell<T>` 类型,用于支持在单核处理器上安全地在线程间共享可变全局变量。这个类型大致结构如下所示:

.. code-block:: Rust
:linenos:
Expand Down
2 changes: 1 addition & 1 deletion chapter8/0intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ <h3>同步互斥机制的设计实现<a class="headerlink" href="#id12" title="
<span class="linenos">7</span><span class="w"> </span><span class="p">}</span>
</pre></div>
</div>
<p>在互斥锁的设计实现中,设计了一个更底层的 <cite>UPSafeCellSafeCell&lt;T&gt;</cite> 类型,用于支持在单核处理器上安全地在线程间共享可变全局变量。这个类型大致结构如下所示:</p>
<p>在互斥锁的设计实现中,设计了一个更底层的 <cite>UPSafeCell&lt;T&gt;</cite> 类型,用于支持在单核处理器上安全地在线程间共享可变全局变量。这个类型大致结构如下所示:</p>
<div class="highlight-Rust notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="w"> </span><span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">UPSafeCell</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="c1">//允许在单核上安全使用可变全局变量</span>
<span class="linenos"> 2</span><span class="w"> </span><span class="n">inner</span>: <span class="nc">RefCell</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="c1">//提供内部可变性和运行时借用检查</span>
<span class="linenos"> 3</span><span class="w"> </span><span class="p">}</span>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 97ce8c4

Please sign in to comment.