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 {