mirror of https://github.com/PentHertz/srsLTE.git
ue_stack_lte: make sure to execute stack commands on Stack thread
some commands were executed from the calling thread which may lead to concurrent access to members. Detected by TSAN. The patch moves all remaining calls (the majority was alread moved) to the Stack task queue.
This commit is contained in:
parent
a9ad408f51
commit
3173dedf0a
|
@ -271,6 +271,8 @@ bool ue_stack_lte::switch_on()
|
||||||
|
|
||||||
bool ue_stack_lte::switch_off()
|
bool ue_stack_lte::switch_off()
|
||||||
{
|
{
|
||||||
|
if (running) {
|
||||||
|
ue_task_queue.try_push([this]() {
|
||||||
// generate detach request with switch-off flag
|
// generate detach request with switch-off flag
|
||||||
nas.switch_off();
|
nas.switch_off();
|
||||||
|
|
||||||
|
@ -279,27 +281,36 @@ bool ue_stack_lte::switch_off()
|
||||||
while (not rrc.srbs_flushed() && ++cnt <= timeout_ms) {
|
while (not rrc.srbs_flushed() && ++cnt <= timeout_ms) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
}
|
}
|
||||||
bool detach_sent = true;
|
|
||||||
if (not rrc.srbs_flushed()) {
|
if (not rrc.srbs_flushed()) {
|
||||||
srslog::fetch_basic_logger("NAS").warning("Detach couldn't be sent after %dms.", timeout_ms);
|
srslog::fetch_basic_logger("NAS").warning("Detach couldn't be sent after %dms.", timeout_ms);
|
||||||
detach_sent = false;
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
return detach_sent;
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ue_stack_lte::enable_data()
|
bool ue_stack_lte::enable_data()
|
||||||
{
|
{
|
||||||
|
if (running) {
|
||||||
|
ue_task_queue.try_push([this]() {
|
||||||
// perform attach request
|
// perform attach request
|
||||||
srsran::console("Turning off airplane mode.\n");
|
srsran::console("Turning off airplane mode.\n");
|
||||||
return nas.enable_data();
|
nas.enable_data();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ue_stack_lte::disable_data()
|
bool ue_stack_lte::disable_data()
|
||||||
{
|
{
|
||||||
|
if (running) {
|
||||||
|
ue_task_queue.try_push([this]() {
|
||||||
// generate detach request
|
// generate detach request
|
||||||
srsran::console("Turning on airplane mode.\n");
|
srsran::console("Turning on airplane mode.\n");
|
||||||
return nas.disable_data();
|
nas.disable_data();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ue_stack_lte::start_service_request()
|
bool ue_stack_lte::start_service_request()
|
||||||
|
|
Loading…
Reference in New Issue