mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Change how Dispatcher is shut down.
The previous use of a timeout resulting in thread detach instead of thread join resulted in a race condition on Mac between destruction and thread closeout. This commit removes the detach functionality and uses dup2() to on Linux/Mac and connecting to itself on Windows to try to ensure accept() exits.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#ifndef TCPSOCKETS_TCPACCEPTOR_H_
|
||||
#define TCPSOCKETS_TCPACCEPTOR_H_
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -35,7 +36,7 @@ class TCPAcceptor : public NetworkAcceptor {
|
||||
int m_port;
|
||||
std::string m_address;
|
||||
bool m_listening;
|
||||
bool m_shutdown;
|
||||
std::atomic_bool m_shutdown;
|
||||
|
||||
public:
|
||||
TCPAcceptor(int port, const char* address);
|
||||
|
||||
Reference in New Issue
Block a user