GStaticRecMutex op_hash_mutex;
GHashTable *id_to_op;
gint active_ops;
- gint poll_timeout;
+ guint poll_timeout;
/* summary file related */
gchar *summary_file_name;
bl->priv->active_ops++;
- if (bl->priv->poll_timeout == -1) {
- bl->priv->poll_timeout = g_timeout_add (LDAP_POLL_INTERVAL,
- (GSourceFunc) poll_ldap,
- bl);
- }
+ if (bl->priv->poll_timeout == 0)
+ bl->priv->poll_timeout = g_timeout_add (
+ LDAP_POLL_INTERVAL,
+ (GSourceFunc) poll_ldap, bl);
g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
}
bl->priv->active_ops--;
if (bl->priv->active_ops == 0) {
- if (bl->priv->poll_timeout != -1)
+ if (bl->priv->poll_timeout > 0) {
g_source_remove (bl->priv->poll_timeout);
- bl->priv->poll_timeout = -1;
+ bl->priv->poll_timeout = 0;
+ }
}
g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
}
g_static_rec_mutex_lock (&eds_ldap_handler_lock);
if (!bl->priv->ldap) {
g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
- bl->priv->poll_timeout = -1;
+ bl->priv->poll_timeout = 0;
return FALSE;
}
g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
if (!bl->priv->active_ops) {
g_warning ("poll_ldap being called for backend with no active operations");
- bl->priv->poll_timeout = -1;
+ bl->priv->poll_timeout = 0;
return FALSE;
}
ldap_unbind (priv->ldap);
g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
- if (priv->poll_timeout != -1)
+ if (priv->poll_timeout > 0)
g_source_remove (priv->poll_timeout);
g_slist_foreach (priv->supported_fields, (GFunc) g_free, NULL);
backend->priv->ldap_limit = 100;
backend->priv->id_to_op = g_hash_table_new (g_int_hash, g_int_equal);
- backend->priv->poll_timeout = -1;
g_static_rec_mutex_init (&backend->priv->op_hash_mutex);