1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-13 21:06:22 +02:00

concurrency/send-sync translate to Farsi (#2301)

concurrency/send-sync to Farsi

---------

Co-authored-by: javad-jafari <javajafarifromsharak@gmail.com>
Co-authored-by: javad-jafari <65780584+javad-jafari@users.noreply.github.com>
This commit is contained in:
Danny Khosravi 2024-08-22 05:23:44 +03:30 committed by GitHub
parent 73612991be
commit d8ab3e0009
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

142
po/fa.po
View File

@ -18390,18 +18390,25 @@ msgid ""
"How does Rust know to forbid shared access across threads? The answer is in " "How does Rust know to forbid shared access across threads? The answer is in "
"two traits:" "two traits:"
msgstr "" msgstr ""
"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در "
"دو trait است:"
#: src/concurrency/send-sync/marker-traits.md:6 #: src/concurrency/send-sync/marker-traits.md:6
msgid "" msgid ""
"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` "
"is `Send` if it is safe to move a `T` across a thread boundary." "is `Send` if it is safe to move a `T` across a thread boundary."
msgstr "" msgstr ""
"‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که "
"جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است."
#: src/concurrency/send-sync/marker-traits.md:8 #: src/concurrency/send-sync/marker-traits.md:8
msgid "" msgid ""
"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` "
"is `Sync` if it is safe to move a `&T` across a thread boundary." "is `Sync` if it is safe to move a `&T` across a thread boundary."
msgstr "" msgstr ""
"‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که "
"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس "
"`Sync` است."
#: src/concurrency/send-sync/marker-traits.md:11 #: src/concurrency/send-sync/marker-traits.md:11
msgid "" msgid ""
@ -18410,22 +18417,30 @@ msgid ""
"only contain `Send` and `Sync` types. You can also implement them manually " "only contain `Send` and `Sync` types. You can also implement them manually "
"when you know it is valid." "when you know it is valid."
msgstr "" msgstr ""
"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). "
"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط "
"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی "
"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است."
#: src/concurrency/send-sync/marker-traits.md:22 #: src/concurrency/send-sync/marker-traits.md:22
msgid "" msgid ""
"One can think of these traits as markers that the type has certain thread-" "One can think of these traits as markers that the type has certain thread-"
"safety properties." "safety properties."
msgstr "" msgstr ""
"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-"
"safety خاصی را دارد."
#: src/concurrency/send-sync/marker-traits.md:24 #: src/concurrency/send-sync/marker-traits.md:24
msgid "They can be used in the generic constraints as normal traits." msgid "They can be used in the generic constraints as normal traits."
msgstr "" msgstr "آنها را می‌توان در محدودیت‌های generic به عنوان trait عادی استفاده کرد."
#: src/concurrency/send-sync/send.md:3 #: src/concurrency/send-sync/send.md:3
msgid "" msgid ""
"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " "A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) "
"if it is safe to move a `T` value to another thread." "if it is safe to move a `T` value to another thread."
msgstr "" msgstr ""
"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://"
"doc.rust-lang.org/std/marker/trait.Send.html) است."
#: src/concurrency/send-sync/send.md:5 #: src/concurrency/send-sync/send.md:5
msgid "" msgid ""
@ -18433,26 +18448,35 @@ msgid ""
"run in that thread. So the question is when you can allocate a value in one " "run in that thread. So the question is when you can allocate a value in one "
"thread and deallocate it in another." "thread and deallocate it in another."
msgstr "" msgstr ""
"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که "
"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این "
"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در "
"thread دیگر توزیع کنید."
#: src/concurrency/send-sync/send.md:14 #: src/concurrency/send-sync/send.md:14
msgid "" msgid ""
"As an example, a connection to the SQLite library must only be accessed from " "As an example, a connection to the SQLite library must only be accessed from "
"a single thread." "a single thread."
msgstr "" msgstr ""
"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی "
"باشد."
#: src/concurrency/send-sync/sync.md:3 #: src/concurrency/send-sync/sync.md:3
msgid "" msgid ""
"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " "A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) "
"if it is safe to access a `T` value from multiple threads at the same time." "if it is safe to access a `T` value from multiple threads at the same time."
msgstr "" msgstr ""
"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait."
"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور "
"همزمان امن باشد."
#: src/concurrency/send-sync/sync.md:6 #: src/concurrency/send-sync/sync.md:6
msgid "More precisely, the definition is:" msgid "More precisely, the definition is:"
msgstr "" msgstr "به طور دقیق‌تر، تعریف این طور است:"
#: src/concurrency/send-sync/sync.md:8 #: src/concurrency/send-sync/sync.md:8
msgid "`T` is `Sync` if and only if `&T` is `Send`" msgid "`T` is `Sync` if and only if `&T` is `Send`"
msgstr "" msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد."
#: src/concurrency/send-sync/sync.md:15 #: src/concurrency/send-sync/sync.md:15
msgid "" msgid ""
@ -18460,6 +18484,9 @@ msgid ""
"thread-safe for shared use, it is also thread-safe to pass references of it " "thread-safe for shared use, it is also thread-safe to pass references of it "
"across threads." "across threads."
msgstr "" msgstr ""
"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای "
"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز "
"امن است."
#: src/concurrency/send-sync/sync.md:19 #: src/concurrency/send-sync/sync.md:19
msgid "" msgid ""
@ -18469,109 +18496,130 @@ msgid ""
"is also safe to move to another thread, because the data it references can " "is also safe to move to another thread, because the data it references can "
"be accessed from any thread safely." "be accessed from any thread safely."
msgstr "" msgstr ""
"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن "
"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به "
"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ "
"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع "
"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند."
#: src/concurrency/send-sync/examples.md:3 #: src/concurrency/send-sync/examples.md:3
msgid "`Send + Sync`" msgid "`Send + Sync`"
msgstr "" msgstr "`Send + Sync`"
#: src/concurrency/send-sync/examples.md:5 #: src/concurrency/send-sync/examples.md:5
msgid "Most types you come across are `Send + Sync`:" msgid "Most types you come across are `Send + Sync`:"
msgstr "" msgstr "اکثر انواعی که با آنها روبرو می شوید `Send + Sync` هستند:"
#: src/concurrency/send-sync/examples.md:7 #: src/concurrency/send-sync/examples.md:7
msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..." msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..."
msgstr "" msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..."
#: src/concurrency/send-sync/examples.md:8 #: src/concurrency/send-sync/examples.md:8
msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..."
msgstr "" msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..."
#: src/concurrency/send-sync/examples.md:9 #: src/concurrency/send-sync/examples.md:9
msgid "`String`, `Option<T>`, `Vec<T>`, `Box<T>`, ..." msgid "`String`, `Option<T>`, `Vec<T>`, `Box<T>`, ..."
msgstr "" msgstr "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..."
#: src/concurrency/send-sync/examples.md:10 #: src/concurrency/send-sync/examples.md:10
msgid "`Arc<T>`: Explicitly thread-safe via atomic reference count." msgid "`Arc<T>`: Explicitly thread-safe via atomic reference count."
msgstr "" msgstr "`String`, `Option<T>`, `Vec<T>`, `Box<T>`, ..."
#: src/concurrency/send-sync/examples.md:11 #: src/concurrency/send-sync/examples.md:11
msgid "`Mutex<T>`: Explicitly thread-safe via internal locking." msgid "`Mutex<T>`: Explicitly thread-safe via internal locking."
msgstr "" msgstr ""
"‏`Arc<T>`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe."
#: src/concurrency/send-sync/examples.md:12 #: src/concurrency/send-sync/examples.md:12
msgid "`mpsc::Sender<T>`: As of 1.72.0." msgid "`mpsc::Sender<T>`: As of 1.72.0."
msgstr "" msgstr "`mpsc::Sender<T>`: از 1.72.0."
#: src/concurrency/send-sync/examples.md:13 #: src/concurrency/send-sync/examples.md:13
msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions."
msgstr "" msgstr ""
"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند."
#: src/concurrency/send-sync/examples.md:15 #: src/concurrency/send-sync/examples.md:15
msgid "" msgid ""
"The generic types are typically `Send + Sync` when the type parameters are " "The generic types are typically `Send + Sync` when the type parameters are "
"`Send + Sync`." "`Send + Sync`."
msgstr "" msgstr ""
"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` "
"هستند.`Send + Sync`."
#: src/concurrency/send-sync/examples.md:18 #: src/concurrency/send-sync/examples.md:18
msgid "`Send + !Sync`" msgid "`Send + !Sync`"
msgstr "" msgstr "`Send + !Sync`"
#: src/concurrency/send-sync/examples.md:20 #: src/concurrency/send-sync/examples.md:20
msgid "" msgid ""
"These types can be moved to other threads, but they're not thread-safe. " "These types can be moved to other threads, but they're not thread-safe. "
"Typically because of interior mutability:" "Typically because of interior mutability:"
msgstr "" msgstr ""
"این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور "
"معمول به دلیل تغییرپذیری داخلی(interior mutability):"
#: src/concurrency/send-sync/examples.md:23 #: src/concurrency/send-sync/examples.md:23
msgid "`mpsc::Receiver<T>`" msgid "`mpsc::Receiver<T>`"
msgstr "" msgstr "`mpsc::Receiver<T>`"
#: src/concurrency/send-sync/examples.md:24 #: src/concurrency/send-sync/examples.md:24
msgid "`Cell<T>`" msgid "`Cell<T>`"
msgstr "" msgstr "`Cell<T>`"
#: src/concurrency/send-sync/examples.md:25 #: src/concurrency/send-sync/examples.md:25
msgid "`RefCell<T>`" msgid "`RefCell<T>`"
msgstr "" msgstr "`RefCell<T>`"
#: src/concurrency/send-sync/examples.md:27 #: src/concurrency/send-sync/examples.md:27
msgid "`!Send + Sync`" msgid "`!Send + Sync`"
msgstr "" msgstr "`!Send + Sync`"
#: src/concurrency/send-sync/examples.md:29 #: src/concurrency/send-sync/examples.md:29
msgid "" msgid ""
"These types are thread-safe, but they cannot be moved to another thread:" "These types are thread-safe, but they cannot be moved to another thread:"
msgstr "" msgstr ""
"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری "
"منتقل کرد:"
#: src/concurrency/send-sync/examples.md:31 #: src/concurrency/send-sync/examples.md:31
msgid "" msgid ""
"`MutexGuard<T: Sync>`: Uses OS level primitives which must be deallocated on " "`MutexGuard<T: Sync>`: Uses OS level primitives which must be deallocated on "
"the thread which created them." "the thread which created them."
msgstr "" msgstr ""
"‏«MutexGuard<T: Sync>»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در "
"threadای که آنها را ایجاد کرده است، توزیع شوند."
#: src/concurrency/send-sync/examples.md:34 #: src/concurrency/send-sync/examples.md:34
msgid "`!Send + !Sync`" msgid "`!Send + !Sync`"
msgstr "" msgstr "`!Send + !Sync`"
#: src/concurrency/send-sync/examples.md:36 #: src/concurrency/send-sync/examples.md:36
msgid "These types are not thread-safe and cannot be moved to other threads:" msgid "These types are not thread-safe and cannot be moved to other threads:"
msgstr "" msgstr ""
"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر "
"منتقل کرد:"
#: src/concurrency/send-sync/examples.md:38 #: src/concurrency/send-sync/examples.md:38
msgid "" msgid ""
"`Rc<T>`: each `Rc<T>` has a reference to an `RcBox<T>`, which contains a non-" "`Rc<T>`: each `Rc<T>` has a reference to an `RcBox<T>`, which contains a non-"
"atomic reference count." "atomic reference count."
msgstr "" msgstr ""
"‏\"Rc<T>\": هر \"Rc<T>\" دارای یک ارجاع به \"RcBox<T>\" است که حاوی تعداد "
"مراجع غیر atomic است."
#: src/concurrency/send-sync/examples.md:40 #: src/concurrency/send-sync/examples.md:40
msgid "" msgid ""
"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency "
"considerations." "considerations."
msgstr "" msgstr ""
"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن "
"است ملاحظات همزمانی خاصی داشته باشند."
#: src/concurrency/shared-state.md #: src/concurrency/shared-state.md
msgid "Arc" msgid "Arc"
msgstr "Shared State" msgstr "Arc"
#: src/concurrency/shared-state.md #: src/concurrency/shared-state.md
msgid "Mutex" msgid "Mutex"
@ -18582,44 +18630,55 @@ msgid ""
"[`Arc<T>`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " "[`Arc<T>`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared "
"read-only access via `Arc::clone`:" "read-only access via `Arc::clone`:"
msgstr "" msgstr ""
"‏[`Arc<T>`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد "
"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:"
#: src/concurrency/shared-state/arc.md:16 #: src/concurrency/shared-state/arc.md:16
msgid "\"{thread_id:?}: {v:?}\"" msgid "\"{thread_id:?}: {v:?}\""
msgstr "" msgstr "\"{thread_id:?}: {v:?}\""
#: src/concurrency/shared-state/arc.md:21 #: src/concurrency/shared-state/arc.md:21
#: src/concurrency/shared-state/example.md:17 #: src/concurrency/shared-state/example.md:17
#: src/concurrency/shared-state/example.md:46 #: src/concurrency/shared-state/example.md:46
msgid "\"v: {v:?}\"" msgid "\"v: {v:?}\""
msgstr "" msgstr "\"v: {v:?}\""
#: src/concurrency/shared-state/arc.md:30 #: src/concurrency/shared-state/arc.md:30
msgid "" msgid ""
"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` "
"that uses atomic operations." "that uses atomic operations."
msgstr "" msgstr ""
"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از "
"عملیات atomic استفاده می‌کند."
#: src/concurrency/shared-state/arc.md:32 #: src/concurrency/shared-state/arc.md:32
msgid "" msgid ""
"`Arc<T>` implements `Clone` whether or not `T` does. It implements `Send` " "`Arc<T>` implements `Clone` whether or not `T` does. It implements `Send` "
"and `Sync` if and only if `T` implements them both." "and `Sync` if and only if `T` implements them both."
msgstr "" msgstr ""
"‏\"Arc<T>\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می "
"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی "
"آنها را پیاده‌سازی کند."
#: src/concurrency/shared-state/arc.md:34 #: src/concurrency/shared-state/arc.md:34
msgid "" msgid ""
"`Arc::clone()` has the cost of atomic operations that get executed, but " "`Arc::clone()` has the cost of atomic operations that get executed, but "
"after that the use of the `T` is free." "after that the use of the `T` is free."
msgstr "" msgstr ""
"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن "
"استفاده از `T` آزاد است."
#: src/concurrency/shared-state/arc.md:36 #: src/concurrency/shared-state/arc.md:36
msgid "" msgid ""
"Beware of reference cycles, `Arc` does not use a garbage collector to detect " "Beware of reference cycles, `Arc` does not use a garbage collector to detect "
"them." "them."
msgstr "" msgstr ""
"مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها "
"استفاده نمی‌کند."
#: src/concurrency/shared-state/arc.md:38 #: src/concurrency/shared-state/arc.md:38
msgid "`std::sync::Weak` can help." msgid "`std::sync::Weak` can help."
msgstr "" msgstr "`std::sync::Weak` می‌تواند مفید باشد."
#: src/concurrency/shared-state/mutex.md:3 #: src/concurrency/shared-state/mutex.md:3
msgid "" msgid ""
@ -18628,11 +18687,15 @@ msgid ""
"interface (another form of [interior mutability](../../borrowing/interior-" "interface (another form of [interior mutability](../../borrowing/interior-"
"mutability.md)):" "mutability.md)):"
msgstr "" msgstr ""
"‏[`Mutex<T>`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین "
"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت "
"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../"
"borrowing/interior-mutability.md)) فراهم می‌کند."
#: src/concurrency/shared-state/mutex.md:12 #: src/concurrency/shared-state/mutex.md:12
#: src/concurrency/shared-state/mutex.md:19 #: src/concurrency/shared-state/mutex.md:19
msgid "\"v: {:?}\"" msgid "\"v: {:?}\""
msgstr "" msgstr "\"v: {:?}\""
#: src/concurrency/shared-state/mutex.md:23 #: src/concurrency/shared-state/mutex.md:23
msgid "" msgid ""
@ -18640,38 +18703,49 @@ msgid ""
"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket "
"implementation." "implementation."
msgstr "" msgstr ""
"توجه کنید که چگونه یک [`impl<T: Send> Sync for Mutex<T>`](https://doc.rust-"
"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای "
"کامل آن داریم."
#: src/concurrency/shared-state/mutex.md:33 #: src/concurrency/shared-state/mutex.md:33
msgid "" msgid ""
"`Mutex` in Rust looks like a collection with just one element --- the " "`Mutex` in Rust looks like a collection with just one element --- the "
"protected data." "protected data."
msgstr "" msgstr ""
"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده "
"(protected) به نظر می‌رسد."
#: src/concurrency/shared-state/mutex.md:35 #: src/concurrency/shared-state/mutex.md:35
msgid "" msgid ""
"It is not possible to forget to acquire the mutex before accessing the " "It is not possible to forget to acquire the mutex before accessing the "
"protected data." "protected data."
msgstr "" msgstr ""
"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را "
"فراموش کرد."
#: src/concurrency/shared-state/mutex.md:37 #: src/concurrency/shared-state/mutex.md:37
msgid "" msgid ""
"You can get an `&mut T` from an `&Mutex<T>` by taking the lock. The " "You can get an `&mut T` from an `&Mutex<T>` by taking the lock. The "
"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held."
msgstr "" msgstr ""
"با گرفتن lock می‌توانید `&mut T` را از `&Mutex<T>` دریافت کنید.`MutexGuard` "
"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند."
#: src/concurrency/shared-state/mutex.md:39 #: src/concurrency/shared-state/mutex.md:39
msgid "" msgid ""
"`Mutex<T>` implements both `Send` and `Sync` iff (if and only if) `T` " "`Mutex<T>` implements both `Send` and `Sync` iff (if and only if) `T` "
"implements `Send`." "implements `Send`."
msgstr "" msgstr ""
"‏`Mutex<T>` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` "
"استفاده‌ می‌کنند."
#: src/concurrency/shared-state/mutex.md:41 #: src/concurrency/shared-state/mutex.md:41
msgid "A read-write lock counterpart: `RwLock`." msgid "A read-write lock counterpart: `RwLock`."
msgstr "" msgstr "‏ همتای قفل خواندن و نوشتن: `RwLock`."
#: src/concurrency/shared-state/mutex.md:42 #: src/concurrency/shared-state/mutex.md:42
msgid "Why does `lock()` return a `Result`?" msgid "Why does `lock()` return a `Result`?"
msgstr "" msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟"
#: src/concurrency/shared-state/mutex.md:43 #: src/concurrency/shared-state/mutex.md:43
msgid "" msgid ""
@ -18681,46 +18755,56 @@ msgid ""
"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " "[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). "
"You can call `into_inner()` on the error to recover the data regardless." "You can call `into_inner()` on the error to recover the data regardless."
msgstr "" msgstr ""
"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/"
"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت "
"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] "
"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. "
"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن "
"فراخوانی کنید."
#: src/concurrency/shared-state/example.md:3 #: src/concurrency/shared-state/example.md:3
msgid "Let us see `Arc` and `Mutex` in action:" msgid "Let us see `Arc` and `Mutex` in action:"
msgstr "" msgstr "اجازه دهید `Arc` و `Mutex` را در عمل ببینیم:"
#: src/concurrency/shared-state/example.md:6 #: src/concurrency/shared-state/example.md:6
msgid "// use std::sync::{Arc, Mutex};\n" msgid "// use std::sync::{Arc, Mutex};\n"
msgstr "" msgstr "// use std::sync::{Arc, Mutex};\n"
#: src/concurrency/shared-state/example.md:24 #: src/concurrency/shared-state/example.md:24
msgid "Possible solution:" msgid "Possible solution:"
msgstr "" msgstr "راه‌حل ممکن:"
#: src/concurrency/shared-state/example.md:50 #: src/concurrency/shared-state/example.md:50
msgid "Notable parts:" msgid "Notable parts:"
msgstr "" msgstr "بخش‌های قابل توجه:"
#: src/concurrency/shared-state/example.md:52 #: src/concurrency/shared-state/example.md:52
msgid "" msgid ""
"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are "
"orthogonal." "orthogonal."
msgstr "" msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است."
#: src/concurrency/shared-state/example.md:54 #: src/concurrency/shared-state/example.md:54
msgid "" msgid ""
"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state "
"between threads." "between threads."
msgstr "" msgstr ""
"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت "
"قابل تغییر (mutable) بین threadها است."
#: src/concurrency/shared-state/example.md:56 #: src/concurrency/shared-state/example.md:56
msgid "" msgid ""
"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another "
"thread. Note `move` was added to the lambda signature." "thread. Note `move` was added to the lambda signature."
msgstr "" msgstr ""
"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری "
"منتقل کرد. نکته `move` به lambda signature اضافه شد."
#: src/concurrency/shared-state/example.md:58 #: src/concurrency/shared-state/example.md:58
msgid "" msgid ""
"Blocks are introduced to narrow the scope of the `LockGuard` as much as " "Blocks are introduced to narrow the scope of the `LockGuard` as much as "
"possible." "possible."
msgstr "" msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند."
#: src/concurrency/sync-exercises/dining-philosophers.md:3 #: src/concurrency/sync-exercises/dining-philosophers.md:3
msgid "The dining philosophers problem is a classic problem in concurrency:" msgid "The dining philosophers problem is a classic problem in concurrency:"