MCPcopy Create free account
hub / github.com/beefytech/Beef / Shutdown

Method Shutdown

BeefySysLib/platform/win/Platform.cpp:727–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725 }
726
727 void Shutdown()
728 {
729 OutputDebugStrF("IOCP.Shutdown Start\n");
730
731 //
732 {
733 AutoCrit autoCrit(mCritSect);
734
735 if (mShuttingDown)
736 return;
737
738 mShuttingDown = true;
739
740 if (!IsHandleValid(mIOCompletionPort))
741 return;
742 }
743
744 for (int i = 0; i < (int)mWorkerThreads.size(); i++)
745 ::PostQueuedCompletionStatus(mIOCompletionPort, 0, (ULONG_PTR)1, NULL);
746
747 for (int i = 0; i < (int)mWorkerThreads.size(); i++)
748 {
749 ::WaitForSingleObject(mWorkerThreads[i], INFINITE);
750 ::CloseHandle(mWorkerThreads[i]);
751 }
752
753 ::CloseHandle(mIOCompletionPort);
754 mIOCompletionPort = 0;
755
756 OutputDebugStrF("IOCP.Shutdown Done\n");
757 }
758
759 void AddWorkerThread()
760 {

Callers

nothing calls this directly

Calls 2

IsHandleValidFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected