+ if (server.bgsavethread != (pthread_t) -1) {
+ int state;
+
+ pthread_mutex_lock(&server.bgsavethread_mutex);
+ state = server.bgsavethread_state;
+ pthread_mutex_unlock(&server.bgsavethread_mutex);
+
+ if (state == REDIS_BGSAVE_DONE_OK || state == REDIS_BGSAVE_DONE_ERR)
+ {
+ backgroundSaveDoneHandler(
+ (state == REDIS_BGSAVE_DONE_OK) ? 0 : 1, 0);
+ }
+ }
+ } else if (!server.ds_enabled) {