Merge pull request #145 from johnwongx/sync

修复连接槽满判断错误
This commit is contained in:
木头云 2025-05-01 11:13:43 +08:00 committed by GitHub
commit 120d85a2c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,7 +60,7 @@ public:
for (unsigned k = 0;; ipc::yield(k)) {
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.
if (next == 0) {
if (next == curr) {
// connection-slot is full.
return 0;
}