gonzui


Format: Advanced Search

mtkernel_3/kernel/tkernel/klock.hbare sourcepermlink (0.00 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    micro T-Kernel 3.00.00
    4:  *
    5:  *    Copyright (C) 2006-2019 by Ken Sakamura.
    6:  *    This software is distributed under the T-License 2.1.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by TRON Forum(http://www.tron.org) at 2019/12/11.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: /*
   14:  *      klock.h              Kernel Lock
   15:  *      Locked task is the highest run priority.
   16:  *      Unable to nest lock.
   17:  */
   18: 
   19: #ifndef _KLOCK_
   20: #define _KLOCK_
   21: 
   22: typedef struct objlock {
   23:         QUEUE          wtskq;          /* Wait task queue */
   24: } OBJLOCK;
   25: 
   26: Inline void knl_InitOBJLOCK( OBJLOCK *loc )
   27: {
   28:         loc->wtskq.next = NULL;
   29: }
   30: IMPORT void knl_LockOBJ( OBJLOCK* );
   31: IMPORT void knl_UnlockOBJ( OBJLOCK* );
   32: 
   33: Inline BOOL knl_isLockedOBJ( OBJLOCK *loc )
   34: {
   35:         return ( loc->wtskq.next != NULL )? TRUE: FALSE;
   36: }
   37: 
   38: #endif /* KLOCK */