diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-06-04 12:39:28 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-06-05 12:50:38 +0200 |
commit | b426e4abb43c6a6d779858baad4760c2401f9732 (patch) | |
tree | 5d483cc266adc28b98cfc48fc35e2b431b15c642 /Transceiver52M/osmo-trx.cpp | |
parent | 4456b6f132437a95833e3a3d3353836331b9c8a0 (diff) |
Rename and move STOP signal from Transceiver to main
The callback actually belongs there, since it's the code/thread in main the one
actually in charge of stopping everything. It simplifies current code,
and more important, allows for new clients of this signal to use it.
This callback will also be used in forthcoming commits by code
controlling rate_ctr thresholds to stop the process if the VTY
configured threshold is used.
Change-Id: Id4159e64225c6606fef34a74b24f37c3a071aceb
Diffstat (limited to 'Transceiver52M/osmo-trx.cpp')
-rw-r--r-- | Transceiver52M/osmo-trx.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index a79c26e..05489bd 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -123,7 +123,7 @@ static int transc_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { switch (signal) { - case S_TRANSC_STOP_REQUIRED: + case S_MAIN_STOP_REQUIRED: gshutdown = true; break; default: @@ -152,8 +152,6 @@ int makeTransceiver(struct trx_ctx *trx, RadioInterface *radio) return -1; } - transceiver->setSignalHandler(transc_sig_cb); - for (size_t i = 0; i < trx->cfg.num_chans; i++) { fifo = radio->receiveFIFO(i); if (fifo && transceiver->receiveFIFO(fifo, i)) @@ -627,6 +625,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + osmo_signal_register_handler(SS_MAIN, transc_sig_cb, NULL); trx_rate_ctr_init(tall_trx_ctx, g_trx_ctx); srandom(time(NULL)); @@ -641,5 +640,6 @@ int main(int argc, char *argv[]) osmo_fd_unregister(&signal_ofd); osmo_fd_close(&signal_ofd); + osmo_signal_unregister_handler(SS_MAIN, transc_sig_cb, NULL); return 0; } |