| 1 |
/* |
| 2 |
* libmowgli: A collection of useful routines for programming. |
| 3 |
* null_mutexops.c: null mutex operations |
| 4 |
* |
| 5 |
* Copyright (c) 2011 William Pitcock <[email protected]> |
| 6 |
* |
| 7 |
* Permission to use, copy, modify, and/or distribute this software for any |
| 8 |
* purpose with or without fee is hereby granted, provided that the above |
| 9 |
* copyright notice and this permission notice is present in all copies. |
| 10 |
* |
| 11 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 12 |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 13 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 14 |
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
| 15 |
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 16 |
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 17 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 18 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 19 |
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 20 |
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 21 |
* POSSIBILITY OF SUCH DAMAGE. |
| 22 |
*/ |
| 23 |
|
| 24 |
#include "mowgli.h" |
| 25 |
#include "thread/mutex_internal.h" |
| 26 |
|
| 27 |
static int |
| 28 |
mowgli_null_mutex_create(mowgli_mutex_t *mutex) |
| 29 |
{ |
| 30 |
return 0; |
| 31 |
} |
| 32 |
|
| 33 |
static int |
| 34 |
mowgli_null_mutex_lock(mowgli_mutex_t *mutex) |
| 35 |
{ |
| 36 |
return 0; |
| 37 |
} |
| 38 |
|
| 39 |
static int |
| 40 |
mowgli_null_mutex_trylock(mowgli_mutex_t *mutex) |
| 41 |
{ |
| 42 |
return 0; |
| 43 |
} |
| 44 |
|
| 45 |
static int |
| 46 |
mowgli_null_mutex_unlock(mowgli_mutex_t *mutex) |
| 47 |
{ |
| 48 |
return 0; |
| 49 |
} |
| 50 |
|
| 51 |
static int |
| 52 |
mowgli_null_mutex_destroy(mowgli_mutex_t *mutex) |
| 53 |
{ |
| 54 |
return 0; |
| 55 |
} |
| 56 |
|
| 57 |
const mowgli_mutex_ops_t _mowgli_null_mutex_ops = |
| 58 |
{ |
| 59 |
.mutex_create = mowgli_null_mutex_create, |
| 60 |
.mutex_lock = mowgli_null_mutex_lock, |
| 61 |
.mutex_trylock = mowgli_null_mutex_trylock, |
| 62 |
.mutex_unlock = mowgli_null_mutex_unlock, |
| 63 |
.mutex_destroy = mowgli_null_mutex_destroy |
| 64 |
}; |