Removed MAC timers thread and call them from main MAC thread

master
Ismael Gomez 7 years ago
parent f064b83183
commit 6de06457fa

@ -150,27 +150,12 @@ private:
uint8_t pch_payload_buffer[pch_payload_buffer_sz];
/* class that runs a thread to trigger timer callbacks in low priority */
class timer_thread : public thread {
public:
timer_thread(srslte::timers *timers_) : ttisync(10240),running(false),timers(timers_) {start();}
void tti_clock();
void stop();
private:
bool running;
void run_thread();
srslte::tti_sync_cv ttisync;
srslte::timers *timers;
};
/* Functions for MAC Timers */
uint32_t timer_alignment;
uint32_t contention_resolution_timer;
void setup_timers();
void timer_alignment_expire();
srslte::timers timers;
timer_thread timers_thread;
// pointer to MAC PCAP object

@ -43,7 +43,6 @@ namespace srsue {
mac::mac() : ttisync(10240),
timers(64),
timers_thread(&timers),
mux_unit(MAC_NOF_HARQ_PROC),
demux_unit(SRSLTE_MAX_TB*MAC_NOF_HARQ_PROC),
pdu_process_thread(&demux_unit)
@ -95,7 +94,6 @@ void mac::stop()
started = false;
ttisync.increase();
pdu_process_thread.stop();
timers_thread.stop();
wait_thread_finish();
}
@ -161,7 +159,7 @@ void mac::run_thread() {
log_h->step(tti);
timers_thread.tti_clock();
timers.step_all();
// Step all procedures
bsr_procedure.step(tti);
@ -312,6 +310,7 @@ void mac::new_grant_ul(mac_interface_phy::mac_grant_t grant, mac_interface_phy::
void mac::new_grant_ul_ack(mac_interface_phy::mac_grant_t grant, bool ack, mac_interface_phy::tb_action_ul_t* action)
{
log_h->info("new_grant_ul_ack\n");
int tbs = ul_harq.get_current_tbs(tti);
ul_harq.new_grant_ul_ack(grant, ack, action);
if (!ack) {
@ -453,35 +452,6 @@ uint32_t mac::timer_get_unique_id()
}
/********************************************************
*
* Class that runs timers in lower priority
*
*******************************************************/
void mac::timer_thread::tti_clock()
{
ttisync.increase();
}
void mac::timer_thread::run_thread()
{
running=true;
ttisync.set_producer_cntr(0);
ttisync.resync();
while(running) {
ttisync.wait();
timers->step_all();
}
}
void mac::timer_thread::stop()
{
running=false;
ttisync.increase();
wait_thread_finish();
}
/********************************************************
*
* Class that runs a thread to process DL MAC PDUs from

Loading…
Cancel
Save