• R/O
  • SSH
  • HTTPS

akari: Commit


Commit MetaInfo

Revisión623 (tree)
Tiempo2020-01-02 17:21:53
Autorkumaneko

Log Message

(empty log message)

Cambiar Resumen

Diferencia

--- trunk/akari/policy_io.c (revision 622)
+++ trunk/akari/policy_io.c (revision 623)
@@ -1265,7 +1265,7 @@
12651265 static unsigned int ccs_log_count;
12661266
12671267 /* Counter for number of updates. */
1268-static unsigned int ccs_stat_updated[CCS_MAX_POLICY_STAT];
1268+static atomic_t ccs_stat_updated[CCS_MAX_POLICY_STAT];
12691269
12701270 /* Timestamp counter for last updated. */
12711271 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
@@ -5151,10 +5151,7 @@
51515151 struct timeval tv;
51525152 #endif
51535153
5154- /*
5155- * I don't use atomic operations because race condition is not fatal.
5156- */
5157- ccs_stat_updated[index]++;
5154+ atomic_inc(&ccs_stat_updated[index]);
51585155 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
51595156 do_gettimeofday(&tv);
51605157 ccs_stat_modified[index] = tv.tv_sec;
@@ -5180,7 +5177,7 @@
51805177 return;
51815178 for (i = 0; i < CCS_MAX_POLICY_STAT; i++) {
51825179 ccs_io_printf(head, "Policy %-30s %10u", ccs_policy_headers[i],
5183- ccs_stat_updated[i]);
5180+ atomic_read(&ccs_stat_updated[i]));
51845181 if (ccs_stat_modified[i]) {
51855182 struct ccs_time stamp;
51865183 ccs_convert_time(ccs_stat_modified[i], &stamp);
Show on old repository browser