source: soft/giet_vm/libs/libsrl/srl_lock.h @ 214

Last change on this file since 214 was 178, checked in by karaoui, 12 years ago

updating libs.

File size: 944 bytes
RevLine 
[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
[178]23#include "spin_lock.h"
[160]24
[178]25typedef giet_lock_t* srl_lock_t;
[160]26
27/**
28   @this takes a lock.
29
30   @param lock The lock object
31 */
[178]32#define srl_lock_lock(lock) lock_acquire(lock);
[160]33
34/**
[178]35   @this releases a lock.
[160]36
37   @param lock The lock object
38 */
[178]39#define srl_lock_unlock( lock ) lock_release(lock);
[160]40
41/**
42   @this tries to take a lock. @this returns whether the lock was
43   actually taken.
44
45   @param lock The lock object
46   @return 0 if the lock was taken successfully
47 */
[178]48#define srl_lock_try_lock( lock ) lock_try_acquire( lock );
[160]49
50#endif
Note: See TracBrowser for help on using the repository browser.