void client_got_records(struct client *cl)
{
- if (cl->session)
+ struct session *se = cl->session;
+ if (se)
{
- session_alert_watch(cl->session, SESSION_WATCH_SHOW);
- session_alert_watch(cl->session, SESSION_WATCH_RECORD);
+ client_unlock(cl);
+ session_alert_watch(se, SESSION_WATCH_SHOW);
+ session_alert_watch(se, SESSION_WATCH_RECORD);
+ client_lock(cl);
}
}
return r;
}
+void client_lock(struct client *c)
+{
+ yaz_mutex_enter(c->mutex);
+}
+
+void client_unlock(struct client *c)
+{
+ yaz_mutex_leave(c->mutex);
+}
+
void client_incref(struct client *c)
{
pazpar2_incref(&c->ref_count, c->mutex);