Skip to content

Commit 120d85a

Browse files
authored
Merge pull request #145 from johnwongx/sync
修复连接槽满判断错误
2 parents fdcc934 + a6c7c85 commit 120d85a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libipc/circ/elem_def.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class conn_head<P, true> : public conn_head_base {
6060
for (unsigned k = 0;; ipc::yield(k)) {
6161
cc_t curr = this->cc_.load(std::memory_order_acquire);
6262
cc_t next = curr | (curr + 1); // find the first 0, and set it to 1.
63-
if (next == 0) {
63+
if (next == curr) {
6464
// connection-slot is full.
6565
return 0;
6666
}

0 commit comments

Comments
 (0)