| 
| #define  | UT_MUTEX_TYPE(M,  P,  T)   typedef PolicyMutex<M<P>> T; | 
|   | Create a typedef using the MutexType<PolicyType>  More...
  | 
|   | 
| #define  | mutex_create(I,  M)   mutex_init((M), (I), __FILE__, __LINE__) | 
|   | 
| #define  | mutex_enter(M)   mutex_enter_inline(M, UT_LOCATION_HERE) | 
|   | 
| #define  | mutex_enter_nospin(M)   (M)->enter(0, 0, __FILE__, __LINE__) | 
|   | 
| #define  | mutex_enter_nowait(M)   (M)->trylock(__FILE__, __LINE__) | 
|   | 
| #define  | mutex_exit(M)   (M)->exit() | 
|   | 
| #define  | mutex_free(M)   mutex_destroy(M) | 
|   | 
| #define  | mutex_validate(M)   (M)->validate() | 
|   | Checks that the mutex has been initialized.  More...
  | 
|   | 
| #define  | mutex_own(M)   (M)->is_owned() | 
|   | Checks that the current thread owns the mutex.  More...
  | 
|   | 
 | 
| template<typename Mutex >  | 
| void  | mutex_enter_inline (Mutex *m, ut::Location loc) | 
|   | 
| template<typename Mutex >  | 
| void  | mutex_init (Mutex *mutex, latch_id_t id, const char *file_name, uint32_t line) | 
|   | Creates, or rather, initializes a mutex object in a specified memory location (which must be appropriately aligned).  More...
  | 
|   | 
| template<typename Mutex >  | 
| void  | mutex_destroy (Mutex *mutex) | 
|   | Removes a mutex instance from the mutex list.  More...
  | 
|   | 
Policy based mutexes. 
Created 2012-03-24 Sunny Bains. 
 
template<typename Mutex > 
      
        
          | void mutex_init  | 
          ( | 
          Mutex *  | 
          mutex,  | 
        
        
           | 
           | 
          latch_id_t  | 
          id,  | 
        
        
           | 
           | 
          const char *  | 
          file_name,  | 
        
        
           | 
           | 
          uint32_t  | 
          line  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Creates, or rather, initializes a mutex object in a specified memory location (which must be appropriately aligned). 
The mutex is initialized in the reset state. Explicit freeing of the mutex with mutex_free is necessary only if the memory block containing it is freed. Add the mutex instance to the global mutex list. 
- Parameters
 - 
  
    | [in,out] | mutex | mutex to initialise  | 
    | [in] | id | The mutex ID (Latch ID)  | 
    | [in] | file_name | Filename from where it was called  | 
    | [in] | line | Line number in filename from where called  |