MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / startControlThread

Method startControlThread

switch/source/mtpusb.cpp:493–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491 }
492
493 void UsbInterface::startControlThread(void)
494 {
495 if (mCtrlThreadValid) {
496 return;
497 }
498
499 mCtrlRunning.store(true);
500 // Same priority and core hint as the server worker. It spends virtually
501 // all of its life parked in eventWait, so it costs nothing to keep.
502 if (R_SUCCEEDED(threadCreate(&mCtrlThread, controlThreadEntry, this, nullptr, 0x4000, 0x2C, -2)) && R_SUCCEEDED(threadStart(&mCtrlThread))) {
503 mCtrlThreadValid = true;
504 }
505 else {
506 mCtrlRunning.store(false);
507 Logging::error("Failed to start the MTP control-request thread; hosts will re-enumerate the device instead of recovering from an error.");
508 }
509 }
510
511 void UsbInterface::stopControlThread(void)
512 {

Callers

nothing calls this directly

Calls 2

storeMethod · 0.80
errorFunction · 0.50

Tested by

no test coverage detected