Add client_set_state_nb
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 3 Nov 2011 12:40:07 +0000 (13:40 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 3 Nov 2011 12:40:07 +0000 (13:40 +0100)
Is like client_set_state, but never calls session_alert_watch.
This is used in the search phase, when a show is never fired anyway
and also because session is locked already so session_alert_watch
would make a deal-lock.

src/client.c
src/client.h

index e17e604..0a1eb61 100644 (file)
@@ -162,6 +162,11 @@ enum client_state client_get_state(struct client *cl)
     return cl->state;
 }
 
     return cl->state;
 }
 
+void client_set_state_nb(struct client *cl, enum client_state st)
+{
+    cl->state = st;
+}
+
 void client_set_state(struct client *cl, enum client_state st)
 {
     int was_active = 0;
 void client_set_state(struct client *cl, enum client_state st)
 {
     int was_active = 0;
index 2fb8ada..9cc9666 100644 (file)
@@ -52,6 +52,7 @@ void client_show_raw_remove(struct client *cl, void *rr);
 const char *client_get_state_str(struct client *cl);
 enum client_state client_get_state(struct client *cl);
 void client_set_state(struct client *cl, enum client_state st);
 const char *client_get_state_str(struct client *cl);
 enum client_state client_get_state(struct client *cl);
 void client_set_state(struct client *cl, enum client_state st);
+void client_set_state_nb(struct client *cl, enum client_state st);
 struct connection *client_get_connection(struct client *cl);
 struct session_database *client_get_database(struct client *cl);
 void client_set_database(struct client *cl, struct session_database *db);
 struct connection *client_get_connection(struct client *cl);
 struct session_database *client_get_database(struct client *cl);
 void client_set_database(struct client *cl, struct session_database *db);