summaryrefslogtreecommitdiff
path: root/src/bio.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-09-13 16:09:06 +0200
committerantirez <antirez@gmail.com>2011-09-13 16:09:06 +0200
commitf81a5f54d8e8cac73ea198d5061d7b40d40ee942 (patch)
treed19685dc0116a4c50831b6fc2dae3a7fe4aa6215 /src/bio.c
parent02925dd96e3ad5e31a3cdd9abbc2415949de8700 (diff)
downloadredis-f81a5f54d8e8cac73ea198d5061d7b40d40ee942.tar.gz
bio.c typos fixes to make it compile
Diffstat (limited to 'src/bio.c')
-rw-r--r--src/bio.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bio.c b/src/bio.c
index fc85afd80..fce0658f1 100644
--- a/src/bio.c
+++ b/src/bio.c
@@ -33,23 +33,27 @@ list *bio_jobs;
struct bio_job {
int type; /* Job type, for instance BIO_JOB_CLOSE */
void *data; /* Job specific arguments pointer. */
-}
+};
void *bioProcessBackgroundJobs(void *arg);
+/* Make sure we have enough stack to perform all the things we do in the
+ * main thread. */
+#define REDIS_THREAD_STACK_SIZE (1024*1024*4)
+
/* Initialize the background system, spawning the thread. */
void bioInit(void) {
pthread_attr_t attr;
pthread_t thread;
size_t stacksize;
- pthread_mutex_init(bio_mutex,NULL);
- pthread_cond_init(bio_condvar,NULL);
+ pthread_mutex_init(&bio_mutex,NULL);
+ pthread_cond_init(&bio_condvar,NULL);
bio_jobs = listCreate();
/* Set the stack size as by default it may be small in some system */
pthread_attr_init(&attr);
- pthread_attr_getstacksize(&attr);
+ pthread_attr_getstacksize(&attr,&stacksize);
if (!stacksize) stacksize = 1; /* The world is full of Solaris Fixes */
while (stacksize < REDIS_THREAD_STACK_SIZE) stacksize *= 2;
pthread_attr_setstacksize(&attr, stacksize);
@@ -73,6 +77,7 @@ void bioCreateBackgroundJob(int type, void *data) {
void *bioProcessBackgroundJobs(void *arg) {
struct bio_job *job;
+ REDIS_NOTUSED(arg);
pthread_detach(pthread_self());
pthread_mutex_lock(&bio_mutex);