kqueue: Reduce G_GNUC_INTERNAL + G_LOCK abuse

The kqueue file monitoring backend was misusing G_GNUC_INTERNAL for want
of 'static' in a couple of places and also using it to declare a lock
that was never used at all.

Fix those up.
This commit is contained in:
Ryan Lortie 2013-01-13 23:43:44 -05:00
parent 64e1a9ca50
commit 59e46c4928
3 changed files with 4 additions and 6 deletions

View File

@ -43,10 +43,8 @@
static gboolean kh_debug_enabled = FALSE; static gboolean kh_debug_enabled = FALSE;
#define KH_W if (kh_debug_enabled) g_warning #define KH_W if (kh_debug_enabled) g_warning
G_GNUC_INTERNAL G_LOCK_DEFINE (kqueue_lock);
static GHashTable *subs_hash_table = NULL; static GHashTable *subs_hash_table = NULL;
G_GNUC_INTERNAL G_LOCK_DEFINE (hash_lock); G_LOCK_DEFINE_STATIC (hash_lock);
static int kqueue_descriptor = -1; static int kqueue_descriptor = -1;
static int kqueue_socket_pair[] = {-1, -1}; static int kqueue_socket_pair[] = {-1, -1};

View File

@ -35,7 +35,7 @@ static gboolean km_debug_enabled = FALSE;
#define KM_W if (km_debug_enabled) g_warning #define KM_W if (km_debug_enabled) g_warning
static GSList *missing_subs_list = NULL; static GSList *missing_subs_list = NULL;
G_GNUC_INTERNAL G_LOCK_DEFINE (missing_lock); G_LOCK_DEFINE_STATIC (missing_lock);
static volatile gboolean scan_missing_running = FALSE; static volatile gboolean scan_missing_running = FALSE;
static on_create_cb file_appeared_callback; static on_create_cb file_appeared_callback;

View File

@ -36,10 +36,10 @@ static gboolean kt_debug_enabled = FALSE;
#define KT_W if (kt_debug_enabled) g_warning #define KT_W if (kt_debug_enabled) g_warning
static GQueue pick_up_fds_queue = G_QUEUE_INIT; static GQueue pick_up_fds_queue = G_QUEUE_INIT;
G_GNUC_INTERNAL G_LOCK_DEFINE (pick_up_lock); G_LOCK_DEFINE_STATIC (pick_up_lock);
static GSList *remove_fds_list = NULL; static GSList *remove_fds_list = NULL;
G_GNUC_INTERNAL G_LOCK_DEFINE (remove_lock); G_LOCK_DEFINE_STATIC (remove_lock);
/* GIO does not have analogues for NOTE_LINK and(?) NOTE_REVOKE, so /* GIO does not have analogues for NOTE_LINK and(?) NOTE_REVOKE, so
* we do not ask kqueue() to watch for these events for now. */ * we do not ask kqueue() to watch for these events for now. */