POK
mutex.h
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #ifndef __POK_KERNEL_MUTEX_H__
19 #define __POK_KERNEL_MUTEX_H__
20 
21 #include <types.h>
22 #include <errno.h>
23 
24 typedef enum
25 {
26  POK_MUTEX_POLICY_STANDARD = 0,
27  POK_MUTEX_POLICY_PIP = 1,
28  POK_MUTEX_POLICY_PCP = 2
29 }pok_mutex_policy_t;
30 
31 typedef struct
32 {
33  pok_mutex_policy_t policy;
35 
36 pok_ret_t pok_mutex_create (pok_mutex_id_t* id, pok_mutex_attr_t* attr);
37 pok_ret_t pok_mutex_lock (pok_mutex_id_t id);
38 pok_ret_t pok_mutex_trylock (pok_mutex_id_t id, const uint64_t time);
39 pok_ret_t pok_mutex_unlock (pok_mutex_id_t id);
40 
41 #endif