11
11
* Copyright (c) 2004-2006 The Regents of the University of California.
12
12
* All rights reserved.
13
13
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
14
- * Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights
14
+ * Copyright (c) 2013-2017 Los Alamos National Security, LLC. All rights
15
15
* reserved.
16
16
* Copyright (c) 2015-2017 Research Organization for Information Science
17
17
* and Technology (RIST). All rights reserved.
@@ -378,7 +378,7 @@ int32_t ompi_datatype_copy_args( const ompi_datatype_t* source_data,
378
378
* a read only memory).
379
379
*/
380
380
if ( NULL != pArgs ) {
381
- OPAL_THREAD_ADD32 (& pArgs -> ref_count , 1 );
381
+ OPAL_THREAD_ADD_FETCH32 (& pArgs -> ref_count , 1 );
382
382
dest_data -> args = pArgs ;
383
383
}
384
384
return OMPI_SUCCESS ;
@@ -396,7 +396,7 @@ int32_t ompi_datatype_release_args( ompi_datatype_t* pData )
396
396
ompi_datatype_args_t * pArgs = (ompi_datatype_args_t * )pData -> args ;
397
397
398
398
assert ( 0 < pArgs -> ref_count );
399
- OPAL_THREAD_ADD32 (& pArgs -> ref_count , -1 );
399
+ OPAL_THREAD_ADD_FETCH32 (& pArgs -> ref_count , -1 );
400
400
if ( 0 == pArgs -> ref_count ) {
401
401
/* There are some duplicated datatypes around that have a pointer to this
402
402
* args. We will release them only when the last datatype will dissapear.
@@ -487,7 +487,8 @@ int ompi_datatype_get_pack_description( ompi_datatype_t* datatype,
487
487
void * recursive_buffer ;
488
488
489
489
if (NULL == packed_description ) {
490
- if (opal_atomic_bool_cmpset (& datatype -> packed_description , NULL , (void * ) 1 )) {
490
+ void * _tmp_ptr = NULL ;
491
+ if (opal_atomic_compare_exchange_strong_ptr (& datatype -> packed_description , (void * ) & _tmp_ptr , (void * ) 1 )) {
491
492
if ( ompi_datatype_is_predefined (datatype ) ) {
492
493
packed_description = malloc (2 * sizeof (int ));
493
494
} else if ( NULL == args ) {
0 commit comments