Skip to content

Commit

Permalink
Remove Channel dependency on CHECK_ON_THREAD()
Browse files Browse the repository at this point in the history
Makes progress on #13.
  • Loading branch information
domfarolino committed Sep 19, 2023
1 parent b22daf0 commit 3442f53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mage/core/channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "base/check.h"
#include "base/scheduling/scheduling_handles.h"
#include "base/threading/thread_checker.h" // for CHECK_ON_THREAD().
#include "mage/core/endpoint.h"

namespace mage {
Expand Down Expand Up @@ -131,7 +130,6 @@ void Channel::SendMessage(Message message) {

void Channel::OnCanReadFromSocket() {
LOG("\n\nChannel::OnCanReadFromSocket() getpid: %d", getpid());
CHECK_ON_THREAD(base::ThreadType::IO);
std::vector<char> full_message_buffer;

// Read the message header.
Expand Down
4 changes: 4 additions & 0 deletions mage/core/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Channel : public base::TaskLoopForIO::SocketReader {
void SendMessage(Message message);

// base::TaskLoopForIO::SocketReader implementation:
//
// See `Start()` documentation above. This method can be called immediately
// after `Start()` on whatever thread the Mage embedder deems is its "IO"
// thread.
void OnCanReadFromSocket() override;

private:
Expand Down

0 comments on commit 3442f53

Please sign in to comment.