int64_t requiredBytes, availBytes;
int idx = 0, cleanupDone = 0;
+ pthread_mutex_lock(&global_lock);
+
dvr_disk_space_config_idx++;
if (dvr_disk_space_config_idx > dvr_disk_space_config_size)
dvr_disk_space_config_idx = 1;
dvr_disk_space_config_idx = 0;
dvr_disk_space_config_size = idx;
+
+ pthread_mutex_unlock(&global_lock);
}
/**
if(statvfs(path, &diskdata) == -1)
return;
+ pthread_mutex_lock(&dvr_disk_space_mutex);
dvr_bfree = diskdata.f_bsize * (int64_t)diskdata.f_bavail;
dvr_btotal = diskdata.f_bsize * (int64_t)diskdata.f_blocks;
+ pthread_mutex_unlock(&dvr_disk_space_mutex);
}
/**
{
if (!dearmed) {
htsmsg_t *m = htsmsg_create_map();
- pthread_mutex_lock(&dvr_disk_space_mutex);
/* update disk space from default dvr config */
dvr_get_disk_space_update((char *)opaque);
htsmsg_add_s64(m, "totaldiskspace", dvr_btotal);
/* check free disk space for each dvr config and start cleanup if needed */
+ pthread_mutex_unlock(&tasklet_lock);
dvr_disk_space_check();
- pthread_mutex_unlock(&dvr_disk_space_mutex);
+ pthread_mutex_lock(&tasklet_lock);
notify_by_msg("diskspaceUpdate", m, 0);
}
extern int tvheadend_running;
extern pthread_mutex_t global_lock;
+extern pthread_mutex_t tasklet_lock;
extern pthread_mutex_t fork_lock;
extern int tvheadend_webui_port;