mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-09 06:08:01 +02:00
_dbus_lock|unlock(): Dump pointer of DBusGlobalLock and mutex with TRACE_LOCKS defined
This commit is contained in:
parent
abc42f388e
commit
aff1e44011
1 changed files with 12 additions and 0 deletions
|
|
@ -31,6 +31,12 @@
|
|||
/* Protected by _dbus_threads_lock_platform_specific() */
|
||||
static int thread_init_generation = 0;
|
||||
|
||||
#ifdef DBUS_DISABLE_CHECKS
|
||||
#undef TRACE_LOCKS
|
||||
#else
|
||||
#define TRACE_LOCKS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup DBusThreadsInternals Thread functions
|
||||
* @ingroup DBusInternals
|
||||
|
|
@ -347,6 +353,9 @@ _dbus_lock (DBusGlobalLock lock)
|
|||
!dbus_threads_init_default ())
|
||||
return FALSE;
|
||||
|
||||
#ifdef TRACE_LOCKS
|
||||
_dbus_verbose ("LOCK DBusGlobalLock:%d mutex:%p\n", lock, global_locks[lock]);
|
||||
#endif
|
||||
_dbus_platform_rmutex_lock (global_locks[lock]);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -357,6 +366,9 @@ _dbus_unlock (DBusGlobalLock lock)
|
|||
_dbus_assert (lock >= 0);
|
||||
_dbus_assert (lock < _DBUS_N_GLOBAL_LOCKS);
|
||||
|
||||
#ifdef TRACE_LOCKS
|
||||
_dbus_verbose ("UNLOCK DBusGlobalLock:%d mutex:%p\n", lock, global_locks[lock]);
|
||||
#endif
|
||||
_dbus_platform_rmutex_unlock (global_locks[lock]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue