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:
crs
2002-07-18 17:00:48 +00:00
parent 0759cbc104
commit 635c3d1c62
2 changed files with 30 additions and 9 deletions

View File

@@ -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;