Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10462

osal - semaphore should not be used for mutex

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • PDK
    • PDK-6793
    • PDK_J7_06.02.00
    • PROCESSOR_SDK_08.00.00
    • Hide
      j721e-evm
      j7200-evm
      Show
      j721e-evm j7200-evm

      PDK uses of Semaphore as mutex. This can create deadlock as Semaphore is not a mutex as it has no concept of thread ownership

       

      For example:

        Task 1

         FxnA

            Mutex_acquire(a)

            Call FxnB

                 FxnB

                    Mutex_acquire(a)

       

      This example will work correctly as expected if Mutex is implemented using a OS primitive like GateMutex provided by sysbios.

      Instead we use Semaphore and this will cause FxnB to block.

       

      Sysbios provides a mutex primitives under ti.sysbios.gates.

       GateAll can be used if we want Hwi/Swi and Task protected critical section.

       

       

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: