Menu

#336 MD structures handling in multithread application

2.0.3.0
closed
None
2020-08-21
2020-05-12
No

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 )

Discussion

  • Bernd Löhr

    Bernd Löhr - 2020-07-30
    • status: open --> pending
    • assigned_to: Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2020-07-30

    yes, it should ;-)

     
  • Bernd Löhr

    Bernd Löhr - 2020-08-21
    • Status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB