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)
- noRecMutex :: Maybe RecMutex
- recMutexClear :: MonadIO m => RecMutex -> m ()
- recMutexInit :: MonadIO m => RecMutex -> m ()
- recMutexLock :: MonadIO m => RecMutex -> m ()
- recMutexTrylock :: MonadIO m => RecMutex -> m Bool
- recMutexUnlock :: MonadIO m => RecMutex -> m ()
Exported types
Methods
recMutexClear
recMutexClear :: MonadIO m => RecMutex -> m () Source
recMutexInit
recMutexInit :: MonadIO m => RecMutex -> m () Source
recMutexLock
recMutexLock :: MonadIO m => RecMutex -> m () Source
recMutexTrylock
recMutexTrylock :: MonadIO m => RecMutex -> m Bool Source
recMutexUnlock
recMutexUnlock :: MonadIO m => RecMutex -> m () Source