Skip to content

Commit

Permalink
Revert "Revert "CStdEvent: Change GetFDs() to GetFD() since the write…
Browse files Browse the repository at this point in the history
… side of the pipe is an implementation detail""

This reverts commit 06baf6b.
  • Loading branch information
Fulgen301 committed Sep 30, 2023
1 parent 6c28aaa commit 68b67e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/C4Awaiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace C4Awaiter
void SetupCancellation(C4Task::CancellablePromise *const promise)
{
cancellationEvent.emplace();
fds[1].fd = cancellationEvent->GetFDs()[0];
fds[1].fd = cancellationEvent->GetFD();

promise->SetCancellationCallback([](void *const argument)
{
Expand Down Expand Up @@ -217,7 +217,7 @@ namespace C4Awaiter
void SetupCancellation(C4Task::CancellablePromise *const promise)
{
cancellationEvent.emplace();
fds.push_back({.fd = cancellationEvent->GetFDs()[0], .events = POLLIN});
fds.push_back({.fd = cancellationEvent->GetFD(), .events = POLLIN});

promise->SetCancellationCallback([](void *const argument)
{
Expand Down
2 changes: 1 addition & 1 deletion src/StdScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class StdScheduler
std::vector<StdSchedulerProc *> eventProcs;
#else
CStdEvent unblocker;
std::vector<pollfd> fds{{.fd = unblocker.GetFDs()[0], .events = POLLIN}};
std::vector<pollfd> fds{{.fd = unblocker.GetFD(), .events = POLLIN}};
#endif

public:
Expand Down
2 changes: 1 addition & 1 deletion src/StdSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CStdEvent
public:
static CStdEvent AutoReset(bool initialState = false);
#else
std::array<int, 2> GetFDs() const { return {fd[0].load(std::memory_order_acquire), fd[1].load(std::memory_order_acquire)}; }
int GetFD() const noexcept { return fd[0].load(std::memory_order_acquire); }
#endif

private:
Expand Down

0 comments on commit 68b67e4

Please sign in to comment.