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

Method cleanupProcess

source/kernel/kprocess.cpp:181–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void KProcess::cleanupProcess() {
182 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(fdsMutex);
183 removeTimer(&this->timer);
184
185 BHashTable<U32, KFileDescriptorPtr> fdsToClose = this->fds; // make a copy since we can't remove from it while iterating
186 for( const auto& n : fdsToClose ) {
187 clearFdHandle(n.value->handle);
188 }
189 this->attachedShm.clear();
190 this->privateShm.clear();
191 this->mappedFiles.clear();
192 // will be handled when thread exits, we don't want to delete current memory associated with execution
193 if (memory) {
194 memory->cleanup();
195 }
196 XServer* server = XServer::getServer(true);
197 if (server) {
198 server->processExit(id);
199 }
200}
201
202KThread* KProcess::createThread() {
203 KThread* thread = new KThread(KSystem::getNextThreadId(), shared_from_this());

Callers 2

~KProcessMethod · 0.95
exitgroupMethod · 0.95

Calls 4

removeTimerFunction · 0.85
processExitMethod · 0.80
clearMethod · 0.45
cleanupMethod · 0.45

Tested by

no test coverage detected