Debugging of Deadlock-Situations under pOS:
-------------------------------------------

/* aus pExec/Types.h */
enum pOS_DebugSysSemaphorePri
{
  pOSd_SYSSEM_FirstApp  = 109,  // first Pri for Applications
  pOSd_SYSSEM_LastApp   = 61,   // last Pri for Applications

  pOSd_SYSSEM_Unit   = 50,   // iu_Sem
  pOSd_SYSSEM_Gad = 40,   // iu_GadSem
  pOSd_SYSSEM_LInfo  = 30,   // pOS_LayerInfo
  pOSd_SYSSEM_Layer  = 20,   // pOS_Layer
};



In (enum pOS_DebugSysSemaphorePri) the used or usable 
IDs (ln_Pri) are defind. Only in Debug-pOS
the Debug-Mechanism is used. With each access to a
Semaphore there is a test whether the new Sem. has a
identical or lower ln_Pri. If a higher ln_Pri is
detected, this points to a possible Deadlock-Danger
The pOS is only content with nested Semaphore-Obtains
that tend to a lower ln_Pri.
E.g.

ObtainSemaphore( pIntui );  =>  pOSd_SYSSEM_Unit
 ObtainSemaphore( Gad );    =>  pOSd_SYSSEM_Gad
  ObtainSemaphore( Layer ); =>  pOSd_SYSSEM_Layer

   ObtainSemaphore( LayerInfo ); =>  pOSd_SYSSEM_LInfo => ERROR


In order not to test each and every Semaphore, pOS at first tests the 
ln_Pri for >0. All ln_Pri from null are handled without Debug.



©proDAD
