X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu.c;h=efbb4b7890a71524fa8264877f3da63565291591;hp=7ab87c4e4f00fb61ef3a8931494754d7bfcf0188;hb=67c2d80b2b808fe7a6d6d0660ca81c919a81010b;hpb=121a5d44c8cc7197116df73854cb94c6cfbad0b0 diff --git a/urcu.c b/urcu.c index 7ab87c4..efbb4b7 100644 --- a/urcu.c +++ b/urcu.c @@ -3,9 +3,22 @@ * * Userspace RCU library * - * Copyright February 2009 - Mathieu Desnoyers + * Copyright (c) 2009 Mathieu Desnoyers + * 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. */