Update conditional for atomics to use HAVE_C11

This commit is contained in:
Martin Kroeker 2020-07-18 17:05:59 +00:00 committed by GitHub
parent 94bab9d1f9
commit 791e046744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@
int blas_server_avail = 0;
static void * blas_thread_buffer[MAX_PARALLEL_NUMBER][MAX_CPU_NUMBER];
#if __STDC_VERSION__ >= 201112L
#ifdef HAVE_C11
static atomic_bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
#else
static _Bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
@ -320,7 +320,7 @@ int exec_blas(BLASLONG num, blas_queue_t *queue){
while(true) {
for(i=0; i < MAX_PARALLEL_NUMBER; i++) {
#if __STDC_VERSION__ >= 201112L
#ifdef HAVE_C11
_Bool inuse = false;
if(atomic_compare_exchange_weak(&blas_buffer_inuse[i], &inuse, true)) {
#else
@ -345,7 +345,7 @@ int exec_blas(BLASLONG num, blas_queue_t *queue){
exec_threads(&queue[i], buf_index);
}
#if __STDC_VERSION__ >= 201112L
#ifdef HAVE_C11
atomic_store(&blas_buffer_inuse[buf_index], false);
#else
blas_buffer_inuse[buf_index] = false;