[srslte-users] mutex in the sf_worker class

Padorin Kurpinsky padorin.kurpinsky at gmail.com
Fri Aug 30 06:40:20 UTC 2019


Hi, Xavier.

I'm trying to understand the role of mutex in sf_worker in srsUE code.
There is a member variable *mutex* in the sf_worker class (i.e.,
srsue/hdr/phy/sf_worker.h), and some functions in the sf_worker class are
surrounded by mutex_lock() and mutex_unlock(), some are not.

For example, sf_worker::set_tdd_config() does not have mutex_lock() and
mutex_unlock(), sf_worker::work_imp() has mutex_lock() and mutex_unlock().
Why do we need mutex in the sf_worker? Only one sf_worker can be allocated
to the particular tti, so in the particular tti, only one sf_worker can
execute the sf_worker::work_imp() which is surrounded by mutex_lock() and
mutex_unlock(). It seems not necessary to me.. Can you elaborate on the
role of this mutex? What scenario can cause the crash when the mutex is not
used?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.srsran.com/pipermail/srsran-users/attachments/20190830/800e13c2/attachment.htm>


More information about the srsran-users mailing list