Skip to content

Commit 2c0dd24

Browse files
authored
Merge pull request OpenMathLib#5350 from martin-frbg/issue5341
Declare the server_lock mutex volatile in addition to static
2 parents 7ae24d0 + 9bcffbd commit 2c0dd24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

driver/others/blas_server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ static void * blas_thread_buffer[MAX_CPU_NUMBER];
119119

120120
/* Local Variables */
121121
#if defined(USE_PTHREAD_LOCK)
122-
static pthread_mutex_t server_lock = PTHREAD_MUTEX_INITIALIZER;
122+
volatile static pthread_mutex_t server_lock = PTHREAD_MUTEX_INITIALIZER;
123123
#elif defined(USE_PTHREAD_SPINLOCK)
124-
static pthread_spinlock_t server_lock = 0;
124+
volatile static pthread_spinlock_t server_lock = 0;
125125
#else
126-
static unsigned long server_lock = 0;
126+
volatile static unsigned long server_lock = 0;
127127
#endif
128128

129129
#define THREAD_STATUS_SLEEP 2

0 commit comments

Comments
 (0)