MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / run

Method run

Suscan/Analyzer.cpp:63–103  ·  view source on GitHub ↗

Async thread

Source from the content-addressed store, hash-verified

61
62// Async thread
63void
64Analyzer::AsyncThread::run()
65{
66 void *data = nullptr;
67 uint32_t type = 0;
68 bool running = true;
69
70 // FIXME: Capture allocation exceptions!
71 do {
72 type = -1;
73 data = this->owner->read(type);
74
75 switch (type) {
76 case SUSCAN_ANALYZER_MESSAGE_TYPE_SOURCE_INFO:
77 case SUSCAN_ANALYZER_MESSAGE_TYPE_INSPECTOR:
78 case SUSCAN_ANALYZER_MESSAGE_TYPE_PSD:
79 case SUSCAN_ANALYZER_MESSAGE_TYPE_SAMPLES:
80 case SUSCAN_ANALYZER_MESSAGE_TYPE_SOURCE_INIT:
81 case SUSCAN_ANALYZER_MESSAGE_TYPE_INTERNAL:
82 case SUSCAN_ANALYZER_MESSAGE_TYPE_PARAMS:
83 emit message(type, data);
84 break;
85
86 // Exit conditions
87 case SUSCAN_WORKER_MSG_TYPE_HALT:
88 case SUSCAN_ANALYZER_MESSAGE_TYPE_EOS:
89 case SUSCAN_ANALYZER_MESSAGE_TYPE_READ_ERROR:
90 running = false;
91 suscan_analyzer_dispose_message(type, data);
92 break;
93
94 default:
95 // Everything else is disposed
96 suscan_analyzer_dispose_message(type, data);
97 data = nullptr;
98 }
99 } while (running);
100
101 // Emit exit reason
102 emit message(type, data);
103}
104
105Analyzer::AsyncThread::AsyncThread(Analyzer *owner)
106{

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected