Annocate static vars left
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 8 Sep 2009 12:06:59 +0000 (14:06 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 8 Sep 2009 12:06:59 +0000 (14:06 +0200)
src/client.c
src/database.c
src/http.c
src/http_command.c
src/logic.c
src/reclists.c
src/zeerex.c

index d17e640..2cf8eb5 100644 (file)
@@ -102,7 +102,7 @@ static const char *client_states[] = {
     "Client_Disconnected"
 };
 
-static struct client *client_freelist = 0;
+static struct client *client_freelist = 0; /* thread pr */
 
 const char *client_get_state_str(struct client *cl)
 {
index d5b9e75..d7c3356 100644 (file)
@@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <netinet/in.h>
 #endif
 
-static struct host *hosts = 0;  // The hosts we know about 
+static struct host *hosts = 0;  /* thread pr */
 
 static xmlDoc *get_explain_xml(struct conf_targetprofiles *targetprofiles,
                                const char *id)
index ee427fb..87cb644 100644 (file)
@@ -75,8 +75,8 @@ static struct http_channel *http_create(const char *addr,
                                         struct conf_server *server);
 static void http_destroy(IOCHAN i);
 
-static struct http_buf *http_buf_freelist = 0;
-static struct http_channel *http_channel_freelist = 0;
+static struct http_buf *http_buf_freelist = 0;        /* thread pr */
+static struct http_channel *http_channel_freelist = 0; /* thread pr */
 
 struct http_channel_observer_s {
     void *data;
index 73a8b1f..13f421d 100644 (file)
@@ -53,7 +53,8 @@ struct http_session {
     struct http_session *next;
 };
 
-static struct http_session *session_list = 0;
+static struct http_session *session_list = 0; /* thread pr */
+
 void http_session_destroy(struct http_session *s);
 
 static void session_timeout(IOCHAN i, int event)
@@ -155,7 +156,7 @@ static void error(struct http_response *rs,
 
 unsigned int make_sessionid(void)
 {
-    static int seq = 0;
+    static int seq = 0; /* thread pr */
     unsigned int res;
 
     seq++;
index ee30f50..0e77804 100644 (file)
@@ -870,7 +870,8 @@ void statistics(struct session *se, struct statistics *stat)
 
 
 // Master list of connections we're handling events to
-static IOCHAN channel_list = 0; 
+static IOCHAN channel_list = 0;  /* thread pr */
+
 void pazpar2_add_channel(IOCHAN chan)
 {
     chan->next = channel_list;
index a6e63ee..85021c6 100644 (file)
@@ -30,8 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 extern struct parameters global_parameters;
 
-// Not threadsafe
-static struct reclist_sortparms *sortparms = 0;
+static struct reclist_sortparms *qsort_sortparms = 0; /* thread pr */
 
 struct reclist_bucket
 {
@@ -168,7 +167,7 @@ static int reclist_cmp(const void *p1, const void *p2)
     struct reclist_sortparms *s;
     int res = 0;
 
-    for (s = sortparms; s && res == 0; s = s->next)
+    for (s = qsort_sortparms; s && res == 0; s = s->next)
     {
         union data_types *ut1 = r1->sortkeys[s->offset];
         union data_types *ut2 = r2->sortkeys[s->offset];
@@ -214,7 +213,7 @@ static int reclist_cmp(const void *p1, const void *p2)
 
 void reclist_sort(struct reclist *l, struct reclist_sortparms *parms)
 {
-    sortparms = parms;
+    qsort_sortparms = parms;
     qsort(l->flatlist, l->num_records, 
           sizeof(struct record_cluster*), reclist_cmp);
     reclist_rewind(l);
index e72fe53..dcfc4b7 100644 (file)
@@ -385,7 +385,7 @@ static struct zr_map *map(NMEM m, xmlNode *node)
 
 static Zr_setting *findsetting(NMEM m, xmlNode *node, char *name)
 {
-    static Zr_setting *r = 0;
+    static Zr_setting *r = 0; /* thread pr */
     xmlNode *n;
     for (n = node->children; n; n = n->next)
     {