Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The GRecMutex struct is an opaque data structure to represent a recursive mutex. It is similar to a #GMutex with the difference that it is possible to lock a GRecMutex multiple times in the same thread without deadlock. When doing so, care has to be taken to unlock the recursive mutex as often as it has been locked.
If a #GRecMutex is allocated in static storage then it can be used without initialisation. Otherwise, you should call g_rec_mutex_init() on it and g_rec_mutex_clear() when done.
A GRecMutex should only be accessed with the g_rec_mutex_ functions.
- newtype RecMutex = RecMutex (ForeignPtr RecMutex)
- newZeroRecMutex :: MonadIO m => m RecMutex
- noRecMutex :: Maybe RecMutex
- data RecMutexClearMethodInfo
- recMutexClear :: MonadIO m => RecMutex -> m ()
- data RecMutexInitMethodInfo
- recMutexInit :: MonadIO m => RecMutex -> m ()
- data RecMutexLockMethodInfo
- recMutexLock :: MonadIO m => RecMutex -> m ()
- data RecMutexTrylockMethodInfo
- recMutexTrylock :: MonadIO m => RecMutex -> m Bool
- data RecMutexUnlockMethodInfo
- recMutexUnlock :: MonadIO m => RecMutex -> m ()
Exported types
((~) * info (ResolveRecMutexMethod t RecMutex), MethodInfo * info RecMutex p) => IsLabel t (RecMutex -> p) Source | |
((~) * info (ResolveRecMutexMethod t RecMutex), MethodInfo * info RecMutex p) => IsLabelProxy t (RecMutex -> p) Source | |
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexUnlockMethodInfo RecMutex signature Source | |
((~) (TYPE Lifted) signature (m Bool), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexTrylockMethodInfo RecMutex signature Source | |
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexLockMethodInfo RecMutex signature Source | |
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexInitMethodInfo RecMutex signature Source | |
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexClearMethodInfo RecMutex signature Source | |
newZeroRecMutex :: MonadIO m => m RecMutex Source
Construct a RecMutex
struct initialized to zero.
Methods
recMutexClear
data RecMutexClearMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexClearMethodInfo RecMutex signature Source | |
recMutexClear :: MonadIO m => RecMutex -> m () Source
recMutexInit
data RecMutexInitMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexInitMethodInfo RecMutex signature Source | |
recMutexInit :: MonadIO m => RecMutex -> m () Source
recMutexLock
data RecMutexLockMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexLockMethodInfo RecMutex signature Source | |
recMutexLock :: MonadIO m => RecMutex -> m () Source
recMutexTrylock
data RecMutexTrylockMethodInfo Source
((~) (TYPE Lifted) signature (m Bool), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexTrylockMethodInfo RecMutex signature Source | |
recMutexTrylock :: MonadIO m => RecMutex -> m Bool Source
recMutexUnlock
data RecMutexUnlockMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) RecMutexUnlockMethodInfo RecMutex signature Source | |
recMutexUnlock :: MonadIO m => RecMutex -> m () Source