mirror of
https://github.com/debauchee/barrier.git
synced 2026-12-01 08:15:25 +08:00
Fixed BSD unblockPollSocket(). Was signaling to break out of
poll() but there was a race condition where the thread trying to unblock poll() could send the signal before the polling thread had entered poll(). Now using a pipe and polling on that and the client's sockets, and just writing a byte into the pipe to unblock poll. This persists until the next call to poll() so we might force poll() to return once unnecessarily but that's not a problem. This change makes the BSD code similar to the winsock code, which uses a winsock event instead of a pipe.
This commit is contained in:
@@ -40,12 +40,14 @@ public:
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
void unblockThread(CArchThread thread);
|
||||
void setNetworkDataForCurrentThread(void*);
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
//@{
|
||||
|
||||
void* getNetworkDataForThread(CArchThread);
|
||||
|
||||
static CArchMultithreadPosix* getInstance();
|
||||
|
||||
//@}
|
||||
|
||||
Reference in New Issue
Block a user