Merge branch 'locker' into 'master'

doc: Clarify that _locker_new() does not actually allocate memory

See merge request GNOME/glib!1349
This commit is contained in:
Philip Withnall 2020-01-31 15:26:21 +00:00
commit 2f18278da5

View File

@ -283,6 +283,8 @@ typedef void GMutexLocker;
* g_mutex_locker_free(). Using g_mutex_unlock() on @mutex * g_mutex_locker_free(). Using g_mutex_unlock() on @mutex
* while a #GMutexLocker exists can lead to undefined behaviour. * while a #GMutexLocker exists can lead to undefined behaviour.
* *
* No allocation is performed, it is equivalent to a g_mutex_lock() call.
*
* This is intended to be used with g_autoptr(). Note that g_autoptr() * This is intended to be used with g_autoptr(). Note that g_autoptr()
* is only available when using GCC or clang, so the following example * is only available when using GCC or clang, so the following example
* will only work with those compilers: * will only work with those compilers:
@ -328,6 +330,8 @@ g_mutex_locker_new (GMutex *mutex)
* *
* Unlock @locker's mutex. See g_mutex_locker_new() for details. * Unlock @locker's mutex. See g_mutex_locker_new() for details.
* *
* No memory is freed, it is equivalent to a g_mutex_unlock() call.
*
* Since: 2.44 * Since: 2.44
*/ */
static inline void static inline void
@ -352,6 +356,8 @@ typedef void GRecMutexLocker;
* g_rec_mutex_locker_free(). Using g_rec_mutex_unlock() on @rec_mutex * g_rec_mutex_locker_free(). Using g_rec_mutex_unlock() on @rec_mutex
* while a #GRecMutexLocker exists can lead to undefined behaviour. * while a #GRecMutexLocker exists can lead to undefined behaviour.
* *
* No allocation is performed, it is equivalent to a g_rec_mutex_lock() call.
*
* This is intended to be used with g_autoptr(). Note that g_autoptr() * This is intended to be used with g_autoptr(). Note that g_autoptr()
* is only available when using GCC or clang, so the following example * is only available when using GCC or clang, so the following example
* will only work with those compilers: * will only work with those compilers:
@ -397,6 +403,8 @@ g_rec_mutex_locker_new (GRecMutex *rec_mutex)
* *
* Unlock @locker's recursive mutex. See g_rec_mutex_locker_new() for details. * Unlock @locker's recursive mutex. See g_rec_mutex_locker_new() for details.
* *
* No memory is freed, it is equivalent to a g_rec_mutex_unlock() call.
*
* Since: 2.60 * Since: 2.60
*/ */
static inline void static inline void
@ -422,6 +430,8 @@ typedef void GRWLockWriterLocker;
* on @rw_lock while a #GRWLockWriterLocker exists can lead to undefined * on @rw_lock while a #GRWLockWriterLocker exists can lead to undefined
* behaviour. * behaviour.
* *
* No allocation is performed, it is equivalent to a g_rw_lock_writer_lock() call.
*
* This is intended to be used with g_autoptr(). Note that g_autoptr() * This is intended to be used with g_autoptr(). Note that g_autoptr()
* is only available when using GCC or clang, so the following example * is only available when using GCC or clang, so the following example
* will only work with those compilers: * will only work with those compilers:
@ -498,6 +508,8 @@ g_rw_lock_writer_locker_new (GRWLock *rw_lock)
* Release a write lock on @locker's read-write lock. See * Release a write lock on @locker's read-write lock. See
* g_rw_lock_writer_locker_new() for details. * g_rw_lock_writer_locker_new() for details.
* *
* No memory is freed, it is equivalent to a g_rw_lock_writer_unlock() call.
*
* Since: 2.62 * Since: 2.62
*/ */
static inline void static inline void
@ -523,6 +535,8 @@ typedef void GRWLockReaderLocker;
* on @rw_lock while a #GRWLockReaderLocker exists can lead to undefined * on @rw_lock while a #GRWLockReaderLocker exists can lead to undefined
* behaviour. * behaviour.
* *
* No allocation is performed, it is equivalent to a g_rw_lock_reader_lock() call.
*
* This is intended to be used with g_autoptr(). For a code sample, see * This is intended to be used with g_autoptr(). For a code sample, see
* g_rw_lock_writer_locker_new(). * g_rw_lock_writer_locker_new().
* *
@ -543,6 +557,8 @@ g_rw_lock_reader_locker_new (GRWLock *rw_lock)
* Release a read lock on @locker's read-write lock. See * Release a read lock on @locker's read-write lock. See
* g_rw_lock_reader_locker_new() for details. * g_rw_lock_reader_locker_new() for details.
* *
* No memory is freed, it is equivalent to a g_rw_lock_reader_unlock() call.
*
* Since: 2.62 * Since: 2.62
*/ */
static inline void static inline void