Mutex overflow logic with rrc API in phch_recv

master
Ismael Gomez 7 years ago
parent 97546d92a5
commit d3e5aa072e

@ -498,30 +498,33 @@ void phch_recv::run_thread()
/* Radio overflow detected. If CAMPING, go through SFN sync again and when /* Radio overflow detected. If CAMPING, go through SFN sync again and when
* SFN is found again go back to camping * SFN is found again go back to camping
*/ */
if (radio_is_overflow) { if (!pthread_mutex_trylock(&rrc_mutex)) {
// If we are coming back from an overflow if (radio_is_overflow) {
if (radio_overflow_return) { // If we are coming back from an overflow
if (phy_state.is_camping()) { if (radio_overflow_return) {
log_h->info("Successfully resynchronized after overflow. Returning to CAMPING\n"); if (phy_state.is_camping()) {
radio_overflow_return = false; log_h->info("Successfully resynchronized after overflow. Returning to CAMPING\n");
radio_is_overflow = false; radio_overflow_return = false;
} else if (phy_state.is_idle()) { radio_is_overflow = false;
log_h->warning("Could not synchronize SFN after radio overflow. Trying again\n"); } else if (phy_state.is_idle()) {
rrc->out_of_sync(); log_h->warning("Could not synchronize SFN after radio overflow. Trying again\n");
phy_state.force_sfn_sync(); rrc->out_of_sync();
} phy_state.force_sfn_sync();
} else { }
// Overflow has occurred now while camping
if (phy_state.is_camping()) {
log_h->warning("Detected radio overflow while camping. Resynchronizing cell\n");
sfn_p.reset();
phy_state.force_sfn_sync();
radio_overflow_return = true;
} else { } else {
radio_is_overflow = false; // Overflow has occurred now while camping
if (phy_state.is_camping()) {
log_h->warning("Detected radio overflow while camping. Resynchronizing cell\n");
sfn_p.reset();
phy_state.force_sfn_sync();
radio_overflow_return = true;
} else {
radio_is_overflow = false;
}
// If overflow occurs in any other state, it does not harm
} }
// If overflow occurs in any other state, it does not harm
} }
pthread_mutex_unlock(&rrc_mutex);
} }
// Increase TTI counter // Increase TTI counter

Loading…
Cancel
Save