Background I/O library enhanced so that the main thread can query for the number of pending jobs of the specified type.

This commit is contained in:
antirez
2011-09-14 18:39:29 +02:00
parent f190705722
commit fde4e4c428
2 changed files with 52 additions and 2 deletions

View File

@ -1,6 +1,11 @@
/* Exported API */
void bioInit(void);
void bioCreateBackgroundJob(int type, void *data);
unsigned long long bioPendingJobsOfType(int type);
void bioWaitPendingJobsLE(int type, unsigned long long num);
/* Background job opcodes */
#define REDIS_BIO_CLOSE_FILE 1
#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