Make _dbus_mutex_new, _dbus_mutex_free static
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 14 Feb 2012 19:39:41 +0000 (19:39 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 21 Feb 2012 14:41:05 +0000 (14:41 +0000)
They're only called within their module.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=43744
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
dbus/dbus-threads-internal.h
dbus/dbus-threads.c

index 11f9ce2..68aa20a 100644 (file)
@@ -29,8 +29,6 @@
 
 DBUS_BEGIN_DECLS
 
-DBusMutex*   _dbus_mutex_new                 (void);
-void         _dbus_mutex_free                (DBusMutex         *mutex);
 void         _dbus_mutex_lock                (DBusMutex         *mutex);
 void         _dbus_mutex_unlock              (DBusMutex         *mutex);
 void         _dbus_mutex_new_at_location     (DBusMutex        **location_p);
index 37b68ba..5eda6f1 100644 (file)
@@ -47,6 +47,8 @@ static DBusList *uninitialized_condvar_list = NULL;
 /** This is used for the no-op default mutex pointer, just to be distinct from #NULL */
 #define _DBUS_DUMMY_CONDVAR ((DBusCondVar*)0xABCDEF2)
 
+static void _dbus_mutex_free (DBusMutex *mutex);
+
 /**
  * @defgroup DBusThreadsInternals Thread functions
  * @ingroup  DBusInternals
@@ -57,15 +59,7 @@ static DBusList *uninitialized_condvar_list = NULL;
  * @{
  */
 
-/**
- * Creates a new mutex using the function supplied to dbus_threads_init(),
- * or creates a no-op mutex if threads are not initialized.
- * May return #NULL even if threads are initialized, indicating
- * out-of-memory.
- *
- * @returns new mutex or #NULL
- */
-DBusMutex*
+static DBusMutex *
 _dbus_mutex_new (void)
 {
   if (thread_functions.recursive_mutex_new)
@@ -77,9 +71,13 @@ _dbus_mutex_new (void)
 }
 
 /**
- * This does the same thing as _dbus_mutex_new.  It however
- * gives another level of indirection by allocating a pointer
- * to point to the mutex location.  This allows the threading
+ * Creates a new mutex using the function supplied to dbus_threads_init(),
+ * or creates a no-op mutex if threads are not initialized.
+ * May return #NULL even if threads are initialized, indicating
+ * out-of-memory.
+ *
+ * The extra level of indirection given by allocating a pointer
+ * to point to the mutex location allows the threading
  * module to swap out dummy mutexes for real a real mutex so libraries
  * can initialize threads even after the D-Bus API has been used.
  *
@@ -102,11 +100,7 @@ _dbus_mutex_new_at_location (DBusMutex **location_p)
     }
 }
 
-/**
- * Frees a mutex created with dbus_mutex_new(); does
- * nothing if passed a #NULL pointer.
- */
-void
+static void
 _dbus_mutex_free (DBusMutex *mutex)
 {
   if (mutex)