]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl/pthread_spin_init.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / nptl / pthread_spin_init.c
index 8ed47721a5631c5c8eac20299247b427afe209c8..a140253aab1ef769c2f28839def2e764abf2992b 100644 (file)
@@ -1,5 +1,5 @@
 /* pthread_spin_init -- initialize a spin lock.  Generic version.
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
 
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include "pthreadP.h"
 
 int
 pthread_spin_init (pthread_spinlock_t *lock, int pshared)
 {
-  *lock = 0;
+  /* Relaxed MO is fine because this is an initializing store.  */
+  atomic_store_relaxed (lock, 0);
   return 0;
 }