Commit 03e384f3 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Rename struct thread to struct replay_thread in varnishreplay

AIX has a "struct thread" in pthread.h, which conflicts with our
struct thread.  Rename ours to replay_thread.

Fixes #531

Thanks to demik for patch

git-svn-id: http://www.varnish-cache.org/svn/trunk@4152 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 5ed33b24
...@@ -191,7 +191,7 @@ thread_log(int lvl, int errcode, const char *fmt, ...) ...@@ -191,7 +191,7 @@ thread_log(int lvl, int errcode, const char *fmt, ...)
pthread_mutex_unlock(&log_mutex); pthread_mutex_unlock(&log_mutex);
} }
struct thread { struct replay_thread {
pthread_t thread_id; pthread_t thread_id;
struct mailbox mbox; struct mailbox mbox;
...@@ -213,14 +213,14 @@ struct thread { ...@@ -213,14 +213,14 @@ struct thread {
char temp[2048]; char temp[2048];
}; };
static struct thread **threads; static struct replay_thread **threads;
static size_t nthreads; static size_t nthreads;
/* /*
* Clear thread state * Clear thread state
*/ */
static void static void
thread_clear(struct thread *thr) thread_clear(struct replay_thread *thr)
{ {
thr->method = thr->proto = thr->url = NULL; thr->method = thr->proto = thr->url = NULL;
...@@ -237,17 +237,17 @@ thread_clear(struct thread *thr) ...@@ -237,17 +237,17 @@ thread_clear(struct thread *thr)
thr->sock = -1; thr->sock = -1;
} }
#define THREAD_FAIL ((struct thread *)-1) #define THREAD_FAIL ((struct replay_thread *)-1)
static pthread_attr_t thread_attr; static pthread_attr_t thread_attr;
static struct thread * static struct replay_thread *
thread_get(int fd, void *(*thread_main)(void *)) thread_get(int fd, void *(*thread_main)(void *))
{ {
assert(fd != 0); assert(fd != 0);
if (fd >= nthreads) { if (fd >= nthreads) {
struct thread **newthreads = threads; struct replay_thread **newthreads = threads;
size_t newnthreads = nthreads; size_t newnthreads = nthreads;
while (fd >= newnthreads) while (fd >= newnthreads)
...@@ -310,7 +310,7 @@ thread_close(int fd) ...@@ -310,7 +310,7 @@ thread_close(int fd)
* Allocate from thread arena * Allocate from thread arena
*/ */
static void * static void *
thread_alloc(struct thread *thr, size_t len) thread_alloc(struct replay_thread *thr, size_t len)
{ {
void *ptr; void *ptr;
...@@ -326,7 +326,7 @@ thread_alloc(struct thread *thr, size_t len) ...@@ -326,7 +326,7 @@ thread_alloc(struct thread *thr, size_t len)
* trimmed. * trimmed.
*/ */
static char * static char *
trimline(struct thread *thr, const char *str) trimline(struct replay_thread *thr, const char *str)
{ {
size_t len; size_t len;
char *p; char *p;
...@@ -356,7 +356,7 @@ trimline(struct thread *thr, const char *str) ...@@ -356,7 +356,7 @@ trimline(struct thread *thr, const char *str)
* A line is terminated by \r\n * A line is terminated by \r\n
*/ */
static int static int
read_line(struct thread *thr) read_line(struct replay_thread *thr)
{ {
int i, len; int i, len;
...@@ -390,7 +390,7 @@ read_line(struct thread *thr) ...@@ -390,7 +390,7 @@ read_line(struct thread *thr)
* the number of bytes read. * the number of bytes read.
*/ */
static int static int
read_block(struct thread *thr, int len) read_block(struct replay_thread *thr, int len)
{ {
int n, r, tot; int n, r, tot;
...@@ -413,7 +413,7 @@ read_block(struct thread *thr, int len) ...@@ -413,7 +413,7 @@ read_block(struct thread *thr, int len)
/* Receive the response after sending a request. /* Receive the response after sending a request.
*/ */
static int static int
receive_response(struct thread *thr) receive_response(struct replay_thread *thr)
{ {
const char *next; const char *next;
int line_len; int line_len;
...@@ -497,7 +497,7 @@ replay_thread(void *arg) ...@@ -497,7 +497,7 @@ replay_thread(void *arg)
{ {
struct iovec iov[6]; struct iovec iov[6];
char space[1] = " ", crlf[2] = "\r\n"; char space[1] = " ", crlf[2] = "\r\n";
struct thread *thr = arg; struct replay_thread *thr = arg;
struct message *msg; struct message *msg;
enum shmlogtag tag; enum shmlogtag tag;
size_t len; size_t len;
...@@ -643,7 +643,7 @@ static int ...@@ -643,7 +643,7 @@ static int
gen_traffic(void *priv, enum shmlogtag tag, unsigned fd, gen_traffic(void *priv, enum shmlogtag tag, unsigned fd,
unsigned len, unsigned spec, const char *ptr) unsigned len, unsigned spec, const char *ptr)
{ {
struct thread *thr; struct replay_thread *thr;
const char *end; const char *end;
struct message *msg; struct message *msg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment