diff --git a/m-i-shared.h b/m-i-shared.h index c6c069bb..87eb2504 100644 --- a/m-i-shared.h +++ b/m-i-shared.h @@ -44,7 +44,7 @@ type: name of the type of the structure (aka. struct test_s) - not used currently. NOTE: There can be only one interface of this kind in a type! */ #define ISHARED_PTR_INTERFACE(name, type) \ - int M_C(name, _cpt) + atomic_int M_C(name, _cpt) /* Define the intrusive shared pointer type and its static inline functions. USAGE: ISHARED_PTR_DEF(name[, oplist]) */ diff --git a/m-shared.h b/m-shared.h index 841d1868..21ba777f 100644 --- a/m-shared.h +++ b/m-shared.h @@ -63,7 +63,7 @@ #define SHAREDI_PTR_DEF2(name, type, oplist) \ typedef struct M_C3(shared_, name, _s){ \ type *data; /* Pointer to the data */ \ - int cpt; /* Counter of how many points to the data */ \ + atomic_int cpt; /* Counter of how many points to the data */ \ bool combineAlloc; /* Does the data and the ptr share the slot? */ \ } *M_C3(shared_, name, _t)[1]; \ \