diff --git a/po/ja.po b/po/ja.po index 7148c51d6ec4..6c9fdba28223 100644 --- a/po/ja.po +++ b/po/ja.po @@ -14084,6 +14084,8 @@ msgid "" "Rust uses the type system to enforce synchronization of shared data. This is " "primarily done via two types:" msgstr "" +"Rustは共有されたデータの同期を強制するために型システムを利用します。これは主" +"に2つの型により行われます:" #: src/concurrency/shared_state.md:6 msgid "" @@ -14091,12 +14093,18 @@ msgid "" "reference counted `T`: handles sharing between threads and takes care to " "deallocate `T` when the last reference is dropped," msgstr "" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html), アトミックに" +"参照カウントする型 (atomic reference counted)を `T` とするとき : スレッド間" +"の共有を扱い、最後の参照がドロップされたとき `T` をデアロケートすることを担当" +"する、" #: src/concurrency/shared_state.md:8 msgid "" "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): ensures " "mutually exclusive access to the `T` value." msgstr "" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): `T`の値へ" +"の相互排他的なアクセスを確実にする。" #: src/concurrency/shared_state/arc.md:1 msgid "`Arc`" @@ -14107,6 +14115,8 @@ msgid "" "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " "read-only access via `Arc::clone`:" msgstr "" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) は読み取り専用" +"の共有アクセスを`Arc::clone`により可能にします:" #: src/concurrency/shared_state/arc.md:16 msgid "\"{thread_id:?}: {v:?}\"" @@ -14123,28 +14133,37 @@ msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." msgstr "" +"`Arc` は\"Atomic Reference Counted\"の略で、アトミック操作を利用するという点" +"で、`Rc`がスレッド安全になったバージョンのようなものです。" #: src/concurrency/shared_state/arc.md:31 msgid "" "`Arc` implements `Clone` whether or not `T` does. It implements `Send` " "and `Sync` if and only if `T` implements them both." msgstr "" +"`Arc` は `Clone` を実装します。これは`T`が`Clone`を実装するしないに関わり" +"ません。`T`が`Send`と`Sync`の両方を実装している場合で、かつその場合に限り、" +"`Arc` は両者を実装します。" #: src/concurrency/shared_state/arc.md:33 msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." msgstr "" +"`Arc::clone()`には実行されるアトミック操作のコストがあります。ただ、そのよう" +"なアトミック操作の後は、`T`の利用は自由になります。" #: src/concurrency/shared_state/arc.md:35 msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." msgstr "" +"参照サイクルに気をつけてください。`Arc` には参照サイクルを検知するためのガ" +"ベージコレクタはありません。" #: src/concurrency/shared_state/arc.md:36 msgid "`std::sync::Weak` can help." -msgstr "" +msgstr "`std::sync::Weak` が役立ちます。" #: src/concurrency/shared_state/mutex.md:1 msgid "`Mutex`" @@ -14156,6 +14175,9 @@ msgid "" "mutual exclusion _and_ allows mutable access to `T` behind a read-only " "interface:" msgstr "" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) は相互排他" +"を確実にし、 _かつ_ 読み取り専用のインターフェースの裏側で `T` へのミュータブ" +"ルなアクセスを可能にします:" #: src/concurrency/shared_state/mutex.md:11 #: src/concurrency/shared_state/mutex.md:18 @@ -14168,38 +14190,49 @@ msgid "" "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " "implementation." msgstr "" +"[`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/" +"struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) のブランケット実装があることに" +"注目してください。" #: src/concurrency/shared_state/mutex.md:31 msgid "" "`Mutex` in Rust looks like a collection with just one element - the " "protected data." msgstr "" +"Rustにおける`Mutex`とは、一つの要素 — 保護されたデータ — からなるコレクション" +"のようなものです。" #: src/concurrency/shared_state/mutex.md:32 msgid "" "It is not possible to forget to acquire the mutex before accessing the " "protected data." msgstr "" +"保護されたデータにアクセスする前に、相互排他を確保し忘れることはありません。" #: src/concurrency/shared_state/mutex.md:33 msgid "" "You can get an `&mut T` from an `&Mutex` by taking the lock. The " "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" +"`&Mutex` からロックを取得することで、`&mut T`を得ることができます。この" +"`MutexGuard`は`&mut T`が保持されているロックよりも長く存続しないことを保証し" +"ます。" #: src/concurrency/shared_state/mutex.md:35 msgid "" "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " "implements `Send`." msgstr "" +"`T`が`Send`を実装している場合で、かつその場合に限り、`Mutex` は`Send`と" +"`Sync`の両方を実装します。" #: src/concurrency/shared_state/mutex.md:36 msgid "A read-write lock counterpart - `RwLock`." -msgstr "" +msgstr "読み書きのロックの場合に対応するものがあります — `RwLock`。" #: src/concurrency/shared_state/mutex.md:37 msgid "Why does `lock()` return a `Result`? " -msgstr "" +msgstr "なぜ`lock()`は`Result`を返すのでしょう? " #: src/concurrency/shared_state/mutex.md:38 msgid "" @@ -14209,10 +14242,16 @@ msgid "" "[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " "You can call `into_inner()` on the error to recover the data regardless." msgstr "" +"スレッドにパニックを起こした`Mutex`がある場合、保護すべきデータが整合性の欠け" +"た状態にある可能性を伝えるため、`Mutex`は「ポイゾンされた」(\"poisoned\")状" +"態になります。ポイゾンされたMutexに対して `lock()` をコールすると、" +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html)と" +"ともに失敗します。`into_inner()` を用いることで、そのエラーにおいて、とりあえ" +"ずデータを回復することはできます。" #: src/concurrency/shared_state/example.md:3 msgid "Let us see `Arc` and `Mutex` in action:" -msgstr "" +msgstr "`Arc` と `Mutex` の動作を見てみましょう:" #: src/concurrency/shared_state/example.md:6 msgid "// use std::sync::{Arc, Mutex};\n" @@ -14220,35 +14259,42 @@ msgstr "" #: src/concurrency/shared_state/example.md:23 msgid "Possible solution:" -msgstr "" +msgstr "考えられる解決策:" #: src/concurrency/shared_state/example.md:49 msgid "Notable parts:" -msgstr "" +msgstr "注目に値する箇所:" #: src/concurrency/shared_state/example.md:51 msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." msgstr "" +"`v`は `Arc` と `Mutex`の両方でラップされています。なぜなら、それらの関心は互" +"いに独立なものであるからです。" #: src/concurrency/shared_state/example.md:52 msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." msgstr "" +"`Mutex`を`Arc`でラップすることは、スレッド間でミュータブルな状態を共有するた" +"めによく見られるパターンです。" #: src/concurrency/shared_state/example.md:53 msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" +"`v: Arc<_>`は別のスレッドにムーブされる前に、`v2`としてクローンされる必要があ" +"ります。`move` がラムダ式に追加されたことに注意してください。" #: src/concurrency/shared_state/example.md:54 msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." msgstr "" +"ブロック文は`LockGuard`のスコープを可能な限り狭めるために導入されています。" #: src/exercises/concurrency/morning.md:3 msgid "Let us practice our new concurrency skills with"