MCPcopy Create free account
hub / github.com/crownengine/crown / shutdown

Method shutdown

src/device/console_server.cpp:327–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void ConsoleServer::shutdown()
328{
329 if (!_server.is_open())
330 return;
331
332 _output_mutex.lock();
333 _thread_exit.store(true);
334 _output_condition.signal();
335 _output_mutex.unlock();
336
337 // Unlock input thread if it is stuck inside the select().
338 _handlers_semaphore.post();
339 if (_input_thread.is_running())
340 _input_thread.stop();
341
342 // Unlock execute_message_handlers in sync mode.
343 _input_semaphore.post();
344
345 if (_output_thread.is_running())
346 _output_thread.stop();
347
348 ScopedMutex scoped_mutex(_clients_mutex);
349 for (u32 i = 0; i < vector::size(_clients); ++i)
350 _clients[i].socket.close();
351
352 _server.close();
353}
354
355void ConsoleServer::send(u32 client_id, const char *json)
356{

Callers 2

main_data_compilerFunction · 0.45
shutdownFunction · 0.45

Calls 10

signalMethod · 0.80
is_runningMethod · 0.80
sizeFunction · 0.50
is_openMethod · 0.45
lockMethod · 0.45
storeMethod · 0.45
unlockMethod · 0.45
postMethod · 0.45
stopMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected