修复连接槽满判断错误

This commit is contained in:
johnwongx 2025-04-23 11:12:48 +08:00
parent fdcc9340be
commit a6c7c8542f

View File

@ -60,7 +60,7 @@ public:
for (unsigned k = 0;; ipc::yield(k)) { for (unsigned k = 0;; ipc::yield(k)) {
cc_t curr = this->cc_.load(std::memory_order_acquire); cc_t curr = this->cc_.load(std::memory_order_acquire);
cc_t next = curr | (curr + 1); // find the first 0, and set it to 1. cc_t next = curr | (curr + 1); // find the first 0, and set it to 1.
if (next == 0) { if (next == curr) {
// connection-slot is full. // connection-slot is full.
return 0; return 0;
} }