8 | module System.Posix.Pthreads.Types
10 | import Data.C.Integer
11 | import Derive.Finite
12 | import Derive.Prelude
15 | %language ElabReflection
18 | data MutexType : Type where
19 | MUTEX_NORMAL : MutexType
20 | MUTEX_RECURSIVE : MutexType
21 | MUTEX_ERRORCHECK : MutexType
23 | %runElab derive "MutexType" [Show,Eq,Ord,Finite]
26 | data CancelType : Type where
27 | CANCEL_DEFERRED : CancelType
28 | CANCEL_ASYNCHRONOUS : CancelType
30 | %runElab derive "CancelType" [Show,Eq,Ord,Finite]
33 | data CancelState : Type where
34 | CANCEL_ENABLE : CancelState
35 | CANCEL_DISABLE : CancelState
37 | %runElab derive "CancelState" [Show,Eq,Ord,Finite]
41 | mutexCode : MutexType -> Bits8
42 | mutexCode MUTEX_NORMAL = 0
43 | mutexCode MUTEX_RECURSIVE = 1
44 | mutexCode MUTEX_ERRORCHECK = 2
47 | cancelType : CancelType -> Bits8
48 | cancelType CANCEL_DEFERRED = 0
49 | cancelType CANCEL_ASYNCHRONOUS = 1
52 | cancelState : CancelState -> Bits8
53 | cancelState CANCEL_ENABLE = 0
54 | cancelState CANCEL_DISABLE = 1
56 | public export %inline
57 | pthread_t_size : Bits32
60 | public export %inline
61 | mutex_t_size : Bits32
64 | public export %inline
65 | cond_t_size : Bits32