Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Use membar_{producer, consumer}() to ensure proper a...



details:   https://anonhg.NetBSD.org/src/rev/3c4f89e21711
branches:  trunk
changeset: 820525:3c4f89e21711
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Jan 10 22:08:14 2017 +0000

description:
Use membar_{producer,consumer}() to ensure proper access to the "ready"
flag.

diffstat:

 sys/kern/kern_history.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r b82fffbf3b72 -r 3c4f89e21711 sys/kern/kern_history.c
--- a/sys/kern/kern_history.c   Tue Jan 10 21:56:50 2017 +0000
+++ b/sys/kern/kern_history.c   Tue Jan 10 22:08:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_history.c,v 1.13 2017/01/10 00:50:57 pgoyette Exp $        */
+/*     $NetBSD: kern_history.c,v 1.14 2017/01/10 22:08:14 pgoyette Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.13 2017/01/10 00:50:57 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_history.c,v 1.14 2017/01/10 22:08:14 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kernhist.h"
@@ -43,6 +43,7 @@
 #include "opt_biohist.h"
 #include "opt_sysctl.h"
 
+#include <sys/atomic.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/cpu.h>
@@ -289,6 +290,7 @@
        struct kern_history *h;
        const struct sysctlnode *rnode = NULL;
 
+       membar_consumer();
        if (kernhist_sysctl_ready == 0)
                return;
 
@@ -329,6 +331,7 @@
        sysctl_hist_node = rnode->sysctl_num;
 
        kernhist_sysctl_ready = 1;
+       membar_producer();
 
        sysctl_kernhist_new(NULL);
 }



Home | Main Index | Thread Index | Old Index