Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ed56ad56
Commit
ed56ad56
authored
Sep 13, 2011
by
antirez
Browse files
bio.c typos fixes to make it compile
parent
c427f5d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bio.c
View file @
ed56ad56
...
@@ -33,23 +33,27 @@ list *bio_jobs;
...
@@ -33,23 +33,27 @@ list *bio_jobs;
struct
bio_job
{
struct
bio_job
{
int
type
;
/* Job type, for instance BIO_JOB_CLOSE */
int
type
;
/* Job type, for instance BIO_JOB_CLOSE */
void
*
data
;
/* Job specific arguments pointer. */
void
*
data
;
/* Job specific arguments pointer. */
}
}
;
void
*
bioProcessBackgroundJobs
(
void
*
arg
);
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. */
/* Initialize the background system, spawning the thread. */
void
bioInit
(
void
)
{
void
bioInit
(
void
)
{
pthread_attr_t
attr
;
pthread_attr_t
attr
;
pthread_t
thread
;
pthread_t
thread
;
size_t
stacksize
;
size_t
stacksize
;
pthread_mutex_init
(
bio_mutex
,
NULL
);
pthread_mutex_init
(
&
bio_mutex
,
NULL
);
pthread_cond_init
(
bio_condvar
,
NULL
);
pthread_cond_init
(
&
bio_condvar
,
NULL
);
bio_jobs
=
listCreate
();
bio_jobs
=
listCreate
();
/* Set the stack size as by default it may be small in some system */
/* Set the stack size as by default it may be small in some system */
pthread_attr_init
(
&
attr
);
pthread_attr_init
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
);
pthread_attr_getstacksize
(
&
attr
,
&
stacksize
);
if
(
!
stacksize
)
stacksize
=
1
;
/* The world is full of Solaris Fixes */
if
(
!
stacksize
)
stacksize
=
1
;
/* The world is full of Solaris Fixes */
while
(
stacksize
<
REDIS_THREAD_STACK_SIZE
)
stacksize
*=
2
;
while
(
stacksize
<
REDIS_THREAD_STACK_SIZE
)
stacksize
*=
2
;
pthread_attr_setstacksize
(
&
attr
,
stacksize
);
pthread_attr_setstacksize
(
&
attr
,
stacksize
);
...
@@ -73,6 +77,7 @@ void bioCreateBackgroundJob(int type, void *data) {
...
@@ -73,6 +77,7 @@ void bioCreateBackgroundJob(int type, void *data) {
void
*
bioProcessBackgroundJobs
(
void
*
arg
)
{
void
*
bioProcessBackgroundJobs
(
void
*
arg
)
{
struct
bio_job
*
job
;
struct
bio_job
*
job
;
REDIS_NOTUSED
(
arg
);
pthread_detach
(
pthread_self
());
pthread_detach
(
pthread_self
());
pthread_mutex_lock
(
&
bio_mutex
);
pthread_mutex_lock
(
&
bio_mutex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment