If application has 2 threads and thread-1 is calling tlm_process() and at the same time thread-2 is calling tlm_notify() (might also apply other API-calls), threads might modify same resource.
Based on debugging in Linux and MD UDP notification, tlm_process() is sometimes closing the same socket than tlm_notify() is still trying to use.
Code snapshot below:
tlm_process ()
...
if (vos_mutexLock(appHandle->mutexMD) != VOS_NO_ERR)
...
tlm_notify ()
...
trdp_mdCall()
...
trdp_mdCall ()
...
/* KK: should the lock be appHandle->mutexMD ? */
if ( vos_mutexLock(appHandle->mutex) != VOS_NO_ERR )
yes, it should ;-)