mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-17 11:31:35 +08:00
now cancelling and waiting for the accept client thread before
cancelling any other threads. this prevents a race condition where we disconnect a client but it reconnects before we manage to shutdown. that might leave a thread running and the connection won't be closed down properly.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
class CClientProxy;
|
||||
class CHTTPServer;
|
||||
class CPrimaryClient;
|
||||
class CThread;
|
||||
class IClient;
|
||||
class IDataSocket;
|
||||
class IServerProtocol;
|
||||
@@ -118,7 +117,7 @@ private:
|
||||
void closeClients(const CConfig& config);
|
||||
|
||||
// start a thread, adding it to the list of threads
|
||||
void startThread(IJob* adopted);
|
||||
CThread startThread(IJob* adopted);
|
||||
|
||||
// cancel running threads, waiting at most timeout seconds for
|
||||
// them to finish.
|
||||
@@ -171,6 +170,7 @@ private:
|
||||
|
||||
// running threads
|
||||
CThreadList m_threads;
|
||||
CThread* m_acceptClientThread;
|
||||
|
||||
// the screens
|
||||
typedef std::map<CString, IClient*> CClientList;
|
||||
|
||||
Reference in New Issue
Block a user