+ // This first attempt is necessary because the netlink thread
+ // might have held the lock while this thread was blocked on
+ // the lock acquisition just above. And while the netlink thread
+ // had the lock, it could have called pthread_cond_singal, which
+ // obviously wouldn't have woken this thread, since this thread
+ // was not yet waiting on the condition signal. So we need to
+ // loop through the interfaces and check if any have changed
+ // status before we wait on the condition signal
+ send_interface_status();
+
+ pthread_cond_wait(&connectivity_cond, &connectivity_lock);
+
+ send_interface_status();
+
+ pthread_mutex_unlock(&connectivity_lock);
+
+ return 0;
+} /* }}} int *read_interface_status */
+
+static void *connectivity_netlink_thread(void *arg) /* {{{ */
+{
+ pthread_mutex_lock(&connectivity_lock);
+
+ while (connectivity_netlink_thread_loop > 0) {
+ int status;
+
+ pthread_mutex_unlock(&connectivity_lock);
+
+ status = read_event(nl_sock, msg_handler);
+
+ pthread_mutex_lock(&connectivity_lock);
+
+ if (status < 0) {
+ connectivity_netlink_thread_error = 1;
+ break;
+ }
+
+ if (connectivity_netlink_thread_loop <= 0)
+ break;
+ } /* while (connectivity_netlink_thread_loop > 0) */
+
+ pthread_mutex_unlock(&connectivity_lock);
+
+ return ((void *)0);
+} /* }}} void *connectivity_netlink_thread */
+
+static void *connectivity_dequeue_thread(void *arg) /* {{{ */
+{
+ pthread_mutex_lock(&connectivity_lock);
+
+ while (connectivity_dequeue_thread_loop > 0) {