Update
This commit is contained in:
1 parent
b92bae34eb
commit
9dbc48aa5d
2 files changed
+4
-2
No files matched your search
+3
-1
@@ -358,7 +358,7 @@ static inline void M_F(name, _write_read_unlock)(shared_t *out, const shared_t
|
|||||||
|
|
||||||
/* Definition of the type with thread safety. */
|
/* Definition of the type with thread safety. */
|
||||||
//TODO: If PROPERTIES.THREADSAFE, disable the global lock as the container handles it itself.
|
//TODO: If PROPERTIES.THREADSAFE, disable the global lock as the container handles it itself.
|
||||||
//FIXME: Such a property may need to be more fine tuned than globaly.
|
//FIXME: Such a property may need to be more fine tuned than globally.
|
||||||
#define M_SHAR3D_PTR_DEF_TYPE(name, shared_t, type, oplist) \
|
#define M_SHAR3D_PTR_DEF_TYPE(name, shared_t, type, oplist) \
|
||||||
struct M_C(name, _s) { \
|
struct M_C(name, _s) { \
|
||||||
type data; /* Allow safe casting from shared_t* to type* */ \
|
type data; /* Allow safe casting from shared_t* to type* */ \
|
||||||
@@ -712,6 +712,7 @@ M_IF_METHOD(EQUAL, oplist)( \
|
|||||||
fattr bool M_F(name, _equal_p)(const shared_t *o1, const shared_t *o2) \
|
fattr bool M_F(name, _equal_p)(const shared_t *o1, const shared_t *o2) \
|
||||||
{ \
|
{ \
|
||||||
M_ASSERT(o1 != NULL && o2 != NULL); \
|
M_ASSERT(o1 != NULL && o2 != NULL); \
|
||||||
|
if (o1 == o2) return true; \
|
||||||
/* See comment above on _write_read_lock */ \
|
/* See comment above on _write_read_lock */ \
|
||||||
if (o1 > o2) { \
|
if (o1 > o2) { \
|
||||||
M_SWAP(const shared_t *, o1, o2); \
|
M_SWAP(const shared_t *, o1, o2); \
|
||||||
@@ -732,6 +733,7 @@ M_IF_METHOD(CMP, oplist)( \
|
|||||||
{ \
|
{ \
|
||||||
M_ASSERT(o1 != NULL && o2 != NULL); \
|
M_ASSERT(o1 != NULL && o2 != NULL); \
|
||||||
int neg = 1; \
|
int neg = 1; \
|
||||||
|
if (o1 == o2) return 0; \
|
||||||
/* See comment above on _write_read_lock */ \
|
/* See comment above on _write_read_lock */ \
|
||||||
if (o1 > o2) { \
|
if (o1 > o2) { \
|
||||||
M_SWAP(const shared_t *, o1, o2); \
|
M_SWAP(const shared_t *, o1, o2); \
|
||||||
|
|||||||
@@ -215,4 +215,4 @@ int main(void)
|
|||||||
test_array();
|
test_array();
|
||||||
test_array_string();
|
test_array_string();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user