Wed Mar 10 15:05:11 2021 UTC ()
Use __pthread_volatile for ptc_waiters (Greg A. Woods)


(christos)
diff -r1.25 -r1.26 src/lib/libpthread/pthread_types.h

cvs diff -r1.25 -r1.26 src/lib/libpthread/pthread_types.h (expand / switch to unified diff)

--- src/lib/libpthread/pthread_types.h 2020/06/10 22:45:15 1.25
+++ src/lib/libpthread/pthread_types.h 2021/03/10 15:05:11 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pthread_types.h,v 1.25 2020/06/10 22:45:15 ad Exp $ */ 1/* $NetBSD: pthread_types.h,v 1.26 2021/03/10 15:05:11 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2008, 2020 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2008, 2020 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Nathan J. Williams. 8 * by Nathan J. Williams.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -162,27 +162,27 @@ struct __pthread_mutexattr_st { @@ -162,27 +162,27 @@ struct __pthread_mutexattr_st {
162 unsigned int ptma_magic; 162 unsigned int ptma_magic;
163 void *ptma_private; 163 void *ptma_private;
164}; 164};
165 165
166#define _PT_MUTEXATTR_MAGIC 0x44440004 166#define _PT_MUTEXATTR_MAGIC 0x44440004
167#define _PT_MUTEXATTR_DEAD 0xDEAD0004 167#define _PT_MUTEXATTR_DEAD 0xDEAD0004
168 168
169 169
170struct __pthread_cond_st { 170struct __pthread_cond_st {
171 unsigned int ptc_magic; 171 unsigned int ptc_magic;
172 172
173 /* Protects the queue of waiters */ 173 /* Protects the queue of waiters */
174 __pthread_spin_t ptc_lock; 174 __pthread_spin_t ptc_lock;
175 void *volatile ptc_waiters; 175 void *__pthread_volatile ptc_waiters;
176 void *ptc_spare; 176 void *ptc_spare;
177 177
178 pthread_mutex_t *ptc_mutex; /* Current mutex */ 178 pthread_mutex_t *ptc_mutex; /* Current mutex */
179 void *ptc_private; 179 void *ptc_private;
180}; 180};
181 181
182#define _PT_COND_MAGIC 0x55550005 182#define _PT_COND_MAGIC 0x55550005
183#define _PT_COND_DEAD 0xDEAD0005 183#define _PT_COND_DEAD 0xDEAD0005
184 184
185#define _PTHREAD_COND_INITIALIZER { _PT_COND_MAGIC, \ 185#define _PTHREAD_COND_INITIALIZER { _PT_COND_MAGIC, \
186 __SIMPLELOCK_UNLOCKED, \ 186 __SIMPLELOCK_UNLOCKED, \
187 NULL, \ 187 NULL, \
188 NULL, \ 188 NULL, \