| Rev | Line |   | 
|---|
| [160] | 1 | /* | 
|---|
 | 2 |  * This file is part of DSX, development environment for static | 
|---|
 | 3 |  * SoC applications. | 
|---|
 | 4 |  *  | 
|---|
 | 5 |  * This file is distributed under the terms of the GNU General Public | 
|---|
 | 6 |  * License. | 
|---|
 | 7 |  *  | 
|---|
 | 8 |  * Copyright (c) 2006, Nicolas Pouillon, <nipo@ssji.net> | 
|---|
 | 9 |  *     Laboratoire d'informatique de Paris 6 / ASIM, France | 
|---|
 | 10 |  *  | 
|---|
 | 11 |  *  $Id$ | 
|---|
 | 12 |  */ | 
|---|
 | 13 |  | 
|---|
 | 14 | #ifndef SRL_LOCK_H_ | 
|---|
 | 15 | #define SRL_LOCK_H_ | 
|---|
 | 16 |  | 
|---|
 | 17 | /** | 
|---|
 | 18 |  * @file | 
|---|
 | 19 |  * @module{SRL} | 
|---|
 | 20 |  * @short Lock operations | 
|---|
 | 21 |  */ | 
|---|
 | 22 |  | 
|---|
 | 23 | #include "srl_public_types.h" | 
|---|
 | 24 | #include "stdio.h" | 
|---|
 | 25 |  | 
|---|
 | 26 | typedef struct { | 
|---|
 | 27 |         unsigned int lock; | 
|---|
 | 28 | }srl_lock_t; | 
|---|
 | 29 |  | 
|---|
 | 30 | #define SRL_LOCK_INITIALIZER { 0 } | 
|---|
 | 31 |  | 
|---|
 | 32 | /** | 
|---|
 | 33 |    @this takes a lock. | 
|---|
 | 34 |  | 
|---|
 | 35 |    @param lock The lock object | 
|---|
 | 36 |  */ | 
|---|
 | 37 | int srl_lock_lock( srl_lock_t lock ); | 
|---|
 | 38 |  | 
|---|
 | 39 | /** | 
|---|
 | 40 |    @this releases a l-ock. | 
|---|
 | 41 |  | 
|---|
 | 42 |    @param lock The lock object | 
|---|
 | 43 |  */ | 
|---|
 | 44 | void srl_lock_unlock( srl_lock_t lock ); | 
|---|
 | 45 |  | 
|---|
 | 46 | /** | 
|---|
 | 47 |    @this tries to take a lock. @this returns whether the lock was | 
|---|
 | 48 |    actually taken. | 
|---|
 | 49 |  | 
|---|
 | 50 |    @param lock The lock object | 
|---|
 | 51 |    @return 0 if the lock was taken successfully | 
|---|
 | 52 |  */ | 
|---|
 | 53 | int srl_lock_try_lock( srl_lock_t lock ); | 
|---|
 | 54 |  | 
|---|
 | 55 | #endif | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.