} BusData;
/** The slot we have reserved to store BusData.
+ * Protected by _DBUS_LOCK_connection_slots.
*/
static dbus_int32_t bus_data_slot = -1;
/** Number of bus types */
#define N_BUS_TYPES 3
+/* Protected by _DBUS_LOCK_bus, except during shutdown, which can't safely
+ * be done in a threaded application anyway. */
static DBusConnection *bus_connections[N_BUS_TYPES];
static char *bus_connection_addresses[N_BUS_TYPES] = { NULL, NULL, NULL };
-
static DBusBusType activation_bus_type = DBUS_BUS_STARTER;
-
static dbus_bool_t initialized = FALSE;
static void
#include "dbus-test.h"
#include <stdio.h>
+/* Test-only, does not need to be thread-safe */
static int free_counter;
static void
*/
const char *_dbus_no_memory_message = "Not enough memory";
+/* Not necessarily thread-safe, but if writes don't propagate between
+ * threads, the worst that will happen is that we duplicate work in more than
+ * one thread. */
static dbus_bool_t warn_initted = FALSE;
+
+/* Not necessarily thread-safe, but if writes don't propagate between
+ * threads, the worst that will happen is that warnings get their default
+ * fatal/non-fatal nature. */
static dbus_bool_t fatal_warnings = FALSE;
static dbus_bool_t fatal_warnings_on_check_failed = TRUE;
*/
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
+/* Test-only, does not need to be thread-safe */
static dbus_bool_t debug_initialized = FALSE;
static int fail_nth = -1;
static size_t fail_size = 0;
#endif
}
+/* protected by _DBUS_LOCK_pending_call_slots */
static dbus_int32_t notify_user_data_slot = -1;
/**
}
}
+/* Only used in a single-threaded child process, does not need to be
+ * thread-safe */
static int babysit_sigchld_pipe = -1;
static void
#include <windows.h>
+/* Protected by DllMain lock, effectively */
static dbus_bool_t global_init_done = FALSE;
static CRITICAL_SECTION init_lock;
static DWORD dbus_cond_event_tls = TLS_OUT_OF_INDEXES;
-
+/* Protected by DllMain lock, effectively */
static HMODULE dbus_dll_hmodule;
void *
typedef MIB_TCPTABLE_OWNER_PID MIB_TCPTABLE_EX;
typedef PMIB_TCPTABLE_OWNER_PID PMIB_TCPTABLE_EX;
typedef DWORD (WINAPI *ProcAllocateAndGetTcpExtTableFromStack)(PMIB_TCPTABLE_EX*,BOOL,HANDLE,DWORD,DWORD);
+
+/* Not protected by a lock, but if we miss a write, all that
+ * happens is that the lazy initialization will happen in two threads
+ * concurrently - it results in the same value either way so that's OK */
static ProcAllocateAndGetTcpExtTableFromStack lpfnAllocateAndGetTcpExTableFromStack = NULL;
/**
#include "dbus-threads-internal.h"
#include "dbus-list.h"
+/* Protected by _dbus_threads_lock_platform_specific() */
static int thread_init_generation = 0;
/**
_dbus_platform_condvar_wake_one (cond);
}
+/* Protected by _dbus_threads_lock_platform_specific() */
static DBusRMutex *global_locks[_DBUS_N_GLOBAL_LOCKS] = { NULL };
static void
}
}
+/* Protected by _DBUS_LOCK_system_users */
static dbus_bool_t database_locked = FALSE;
static DBusUserDatabase *system_db = NULL;
static DBusString process_username;