From: Adam Dickmeiss Date: Wed, 28 Apr 2010 08:32:49 +0000 (+0200) Subject: ingest_record: lock client, then session X-Git-Tag: v1.4.0~6^2^2^2~4 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=25a2a0bc6bd136a4d9ea6034e7a86c889d02e4e2;p=pazpar2-moved-to-github.git ingest_record: lock client, then session lock client, then session rather than the reverse way. This saves us locking but more importantly prevents that session gets destroyed under our feet (while client and session is not locked). --- diff --git a/src/session.c b/src/session.c index 14b9a2c..309d9ff 100644 --- a/src/session.c +++ b/src/session.c @@ -1172,14 +1172,10 @@ int ingest_record(struct client *cl, const char *rec, xmlFreeDoc(xdoc); return -1; } - client_unlock(cl); session_enter(se); - client_lock(cl); if (client_get_session(cl) == se) ret = ingest_to_cluster(cl, xdoc, root, record_no, mergekey_norm); - client_unlock(cl); session_leave(se); - client_lock(cl); xmlFreeDoc(xdoc); return ret;