Commit 3b30c589 authored by jan.koester's avatar jan.koester
Browse files

test

parent 8faa650d
Loading
Loading
Loading
Loading
+4 −4
Changes for src/event/iocp.cpp: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -104,13 +104,13 @@ namespace netplus {
		}

		void RemoveFromClientList(client* pClientContext) {
			std::unique_lock<std::mutex> lock1(g_ClientContextMutex, std::defer_lock);
			std::unique_lock<std::mutex> lock2(pClientContext->cltmtx, std::defer_lock);
			std::lock(lock1, lock2);

			std::lock_guard<std::mutex> lock(g_ClientContextMutex);
			auto it = std::find(g_ClientContext.begin(), g_ClientContext.end(), pClientContext);
			if (it != g_ClientContext.end()) {
				if (pClientContext->cltmtx.try_lock()) {
					g_ClientContext.erase(it);
					pClientContext->cltmtx.unlock();
				}				
			}
		}