Skip to content
Snippets Groups Projects
Commit a48c3658 authored by Cédric Roux's avatar Cédric Roux
Browse files

bugfix: fix threading in the UE

Various problems were found with the basic simulator.

Variables used by various threads for synchronization need to
be initialized properly. That is before the various threads
start using them.

This goes for:
- UE->is_synchronized
- UE->proc.instance_cnt_synch
- UE->proc.instance_cnt_rxtx

The function "UE->rfdevice.trx_start_func" was called in
"UE_thread_synch" but should be called in "UE_thread" because
"UE_thread" is the one that calls "UE->rfdevice.trx_read_func"
and there is no guaranty that the call to "UE->rfdevice.trx_start_func"
is done before as it has to (it's in another thread).

And finally "pthread_cond_signal(&proc->cond_rxtx)" was called twice,
which may not be a problem but was certainly not intended. Plus
removing one call simplifies the code by removing some "if" logic,
which is a good thing per se.

This commit was not tested with a real UE and may thus introduce some
issues. Hopefully not!
parent 164bbc65
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment