Use sync_core() in the write side to match current formal verif model
[urcu.git] / urcu.c
diff --git a/urcu.c b/urcu.c
index 7ab87c4e4f00fb61ef3a8931494754d7bfcf0188..efbb4b7890a71524fa8264877f3da63565291591 100644 (file)
--- a/urcu.c
+++ b/urcu.c
@@ -3,9 +3,22 @@
  *
  * Userspace RCU library
  *
- * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
  *
- * Distributed under LGPLv2.1
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  * IBM's contributions to this file may be relicensed under LGPLv2 or later.
  */
@@ -235,6 +248,14 @@ void synchronize_rcu(void)
         * Ensured by STORE_SHARED and LOAD_SHARED.
         */
 
+       /*
+        * Current RCU formal verification model assumes sequential execution of
+        * the write-side. Add core synchronization instructions. Can be removed
+        * if the formal model is extended to prove that reordering is still
+        * correct.
+        */
+       sync_core();    /* Formal model assumes serialized execution */
+
        /*
         * Wait for previous parity to be empty of readers.
         */
@@ -248,6 +269,8 @@ void synchronize_rcu(void)
         * Ensured by STORE_SHARED and LOAD_SHARED.
         */
 
+       sync_core();    /* Formal model assumes serialized execution */
+
        switch_next_urcu_qparity();     /* 1 -> 0 */
 
        /*
@@ -258,6 +281,8 @@ void synchronize_rcu(void)
         * Ensured by STORE_SHARED and LOAD_SHARED.
         */
 
+       sync_core();    /* Formal model assumes serialized execution */
+
        /*
         * Wait for previous parity to be empty of readers.
         */
This page took 0.022707 seconds and 4 git commands to generate.