Use a different thread for every different type of background job

This commit is contained in:
antirez
2011-09-15 15:46:29 +02:00
parent 91de5421b2
commit 50be9b97bc
3 changed files with 67 additions and 42 deletions

View File

@ -1,11 +1,10 @@
/* Exported API */
void bioInit(void);
void bioCreateBackgroundJob(int type, void *data);
void bioCreateBackgroundJob(int type, void *arg1, void *arg2, void *arg3);
unsigned long long bioPendingJobsOfType(int type);
void bioWaitPendingJobsLE(int type, unsigned long long num);
time_t bioOlderJobOfType(int type);
/* Background job opcodes */
#define REDIS_BIO_ZERO_OP_ID 0 /* We don't use zero as it is the most likely
* passed value in case of bugs/races. */
#define REDIS_BIO_CLOSE_FILE 1 /* Deferred close(2) syscall. */
#define REDIS_BIO_MAX_OP_ID 1
#define REDIS_BIO_CLOSE_FILE 0 /* Deferred close(2) syscall. */
#define REDIS_BIO_NUM_OPS 1