MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / destroy

Method destroy

source/kernel/ksystem.cpp:97–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96void stopNativeSocketsThread();
97void KSystem::destroy() {
98 KThread::setCurrentThread(nullptr);
99 KSystem::shutingDown = true;
100 while (true) {
101 KProcessPtr p;
102 {
103 BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(processesCond);
104 if (KSystem::processes.size()) {
105 for (auto& process : KSystem::processes) {
106 if (process.value && process.value->getThreadCount()) {
107 p = process.value;
108 break;
109 }
110 }
111 }
112 }
113 if (!p) {
114 break;
115 }
116 p->killAllThreads();
117 }
118 KSystem::procNode = nullptr;
119 KSystem::processes.clear();
120 KSystem::fileCache.clear();
121 KSystem::shutingDown = false;
122 Fs::shutDown();
123 DecodedOp::clearCache();
124 KMemory::shutdown();
125 XServer::shutdown();
126 shutdownRam();
127#ifdef BOXEDWINE_MULTI_THREADED
128 stopNativeSocketsThread();
129#endif
130}
131
132U32 KSystem::getProcessCount() {
133 BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(processesCond);

Callers

nothing calls this directly

Calls 6

shutdownRamFunction · 0.85
stopNativeSocketsThreadFunction · 0.85
getThreadCountMethod · 0.80
killAllThreadsMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected