From ada63bd743de95ca7f1b93734d495c6d559d17b9 Mon Sep 17 00:00:00 2001 From: ShoreCN Date: Fri, 17 Nov 2023 05:25:10 +0800 Subject: [PATCH] fix RwLock deadlock condition fix RwLock deadlock condition --- src/advance/concurrency-with-threads/sync1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advance/concurrency-with-threads/sync1.md b/src/advance/concurrency-with-threads/sync1.md index 5912e6c3..f94f4109 100644 --- a/src/advance/concurrency-with-threads/sync1.md +++ b/src/advance/concurrency-with-threads/sync1.md @@ -390,7 +390,7 @@ fn main() { } ``` -`RwLock`在使用上和`Mutex`区别不大,只有在多个读的情况下不阻塞程序,其他如读写、写读、读读情况下均会对后获取锁的操作进行阻塞。 +`RwLock`在使用上和`Mutex`区别不大,只有在多个读的情况下不阻塞程序,其他如读写、写读、写写情况下均会对后获取锁的操作进行阻塞。 我们也可以使用`try_write`和`try_read`来尝试进行一次写/读,若失败则返回错误: