X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fclient.c;h=c238f0a9f31074da10e394cc06520e46bb3b7d9d;hb=0be537a08d164975e9584a6c89240b28343a6ec2;hp=a9f2406a1e6fc4c82826b9a65ec4f0fc48280af2;hpb=8ffa7e44afe1ae74ec07278d0bcc93b388c39871;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index a9f2406..c238f0a 100644 --- a/src/client.c +++ b/src/client.c @@ -439,10 +439,13 @@ void client_search_response(struct client *cl) 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); } } @@ -623,6 +626,16 @@ struct client *client_create(void) 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);