From 64dc96510f08616817f0d5a22a199a6622b9632f Mon Sep 17 00:00:00 2001 From: Xudong Huang Date: Thu, 25 Apr 2024 15:35:27 +0800 Subject: [PATCH] :pencil: update heck to 0.5 --- may_rpc_derive/Cargo.toml | 2 +- src/conetty/queued_writer.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/may_rpc_derive/Cargo.toml b/may_rpc_derive/Cargo.toml index 6d21b6a..7fc869f 100644 --- a/may_rpc_derive/Cargo.toml +++ b/may_rpc_derive/Cargo.toml @@ -17,7 +17,7 @@ description = "RPC framework for Rust based on coroutine." proc-macro = true [dependencies] -heck = "0.4" +heck = "0.5" quote = "1.0" proc-macro2 = "1.0" syn = { version = "2.0", features = ["full"] } diff --git a/src/conetty/queued_writer.rs b/src/conetty/queued_writer.rs index 08a487a..656acd4 100644 --- a/src/conetty/queued_writer.rs +++ b/src/conetty/queued_writer.rs @@ -54,7 +54,10 @@ impl QueuedWriter { // only allow the first writer perform the write operation // other concurrent writers would just push the data if self.data_count.fetch_add(1, Ordering::AcqRel) == 0 { - // in any cases this should not block since we have only one writer + // it's possible that other writer is blocked by the lock + // e.g. the `write_all()` is blocked and data_count is 0 + // and the next writer would try to acquire the lock + // this only relax the write lock contention let mut writer = self.writer.lock().unwrap(); loop {