mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
修复连接槽满判断错误
This commit is contained in:
parent
fdcc9340be
commit
a6c7c8542f
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user