Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dallison/subspace
Browse files Browse the repository at this point in the history
  • Loading branch information
dallison committed Feb 27, 2024
2 parents 5435370 + 8a4bdeb commit 5e4dacf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ http_archive(
# path = "../cpp_toolbelt",
# )

http_archive(
name = "coroutines",
urls = ["https://github.com/dallison/co/archive/refs/tags/1.3.4.tar.gz"],
strip_prefix = "co-1.3.4",
sha256 = "00b036fcecd0256356bc09b47b049e29f6df34dc97792143630df83591de2c1b"
)
# http_archive(
# name = "coroutines",
# urls = ["https://github.com/dallison/co/archive/refs/tags/1.3.4.tar.gz"],
# strip_prefix = "co-1.3.4",
# sha256 = "00b036fcecd0256356bc09b47b049e29f6df34dc97792143630df83591de2c1b"
# )

# For local debugging of co coroutine library.
# local_repository(
# name = "coroutines",
# path = "../co",
# )
local_repository(
name = "coroutines",
path = "../co",
)

# Bazel python rules.
http_archive(
Expand Down
4 changes: 2 additions & 2 deletions client/client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ TEST_F(ClientTest, ReliablePublisher1) {
// Wait for trigger event in coroutine.
co::Coroutine c1(machine, [&pub](co::Coroutine *c) {
struct pollfd fd = pub->GetPollFd();
c->Wait(fd);
c->Wait(fd.fd);

absl::StatusOr<void *> buffer = pub->GetMessageBuffer();
ASSERT_TRUE(buffer.ok());
Expand Down Expand Up @@ -911,7 +911,7 @@ TEST_F(ClientTest, ReliablePublisher2) {
co::Coroutine c1(machine, [&pub](co::Coroutine *c) {
absl::StatusOr<struct pollfd> fd = pub->GetPollFd();
ASSERT_TRUE(fd.ok());
c->Wait(*fd);
c->Wait(fd->fd);

absl::StatusOr<void *> buffer = pub->GetMessageBuffer();
ASSERT_TRUE(buffer.ok());
Expand Down
4 changes: 2 additions & 2 deletions common/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ class ChannelLock {
std::function<bool(ChannelLock *lock)> reload = nullptr)
: lock_(lock), reload_(std::move(reload)) {
Lock();
if (reload != nullptr) {
if (reload_ != nullptr) {
// This will look to see if a reload is needed and if so,
// unlock the channel, talk to the server and map in the
// new buffers. The lock is reacquired before it returns.
while (reload(this)) {
while (reload_(this)) {
// Nothing to do, just try reloading again.
}
}
Expand Down

0 comments on commit 5e4dacf

Please sign in to comment.