Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/P-p-H-d/mlib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Pelissier <patrick.pelissier@gmail.com>2021-02-11 00:40:44 +0300
committerPatrick Pelissier <patrick.pelissier@gmail.com>2021-02-13 13:45:05 +0300
commit517da1b99920a24c8c218d8e5c30456c0cc5eba4 (patch)
treeba4d76d8ae1c0fcb98e76d7ad6eaeb5f842503b4 /m-concurrent.h
parent25497bd96fe15e29571871ec5a5511f08f0bcc41 (diff)
Rename generated internal functions
to avoid "poluting" userspace naming.
Diffstat (limited to 'm-concurrent.h')
-rw-r--r--m-concurrent.h152
1 files changed, 76 insertions, 76 deletions
diff --git a/m-concurrent.h b/m-concurrent.h
index d7eaecf..ad55a36 100644
--- a/m-concurrent.h
+++ b/m-concurrent.h
@@ -41,7 +41,7 @@
USAGE: CONCURRENT_DEF_AS(name, name_t, type [, oplist_of_the_type]) */
#define CONCURRENT_DEF_AS(name, name_t, ...) \
M_BEGIN_PROTECTED_CODE \
- CONCURRENTI_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \
+ M_C0NCURRENT_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \
((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), name_t ), \
(name, __VA_ARGS__, name_t ))) \
M_END_PROTECTED_CODE
@@ -62,7 +62,7 @@
USAGE: CONCURRENT_RP_DEF_AS(name, name_t, type [, oplist_of_the_type]) */
#define CONCURRENT_RP_DEF_AS(name, name_t, ...) \
M_BEGIN_PROTECTED_CODE \
- CONCURRENTI_RP_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \
+ M_C0NCURRENT_RP_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \
((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), name_t ), \
(name, __VA_ARGS__, name_t ))) \
M_END_PROTECTED_CODE
@@ -71,7 +71,7 @@
/* Define the oplist of a protected concurrent container given its name and its oplist.
USAGE: CONCURRENT_OPLIST(name[, oplist of the type]) */
#define CONCURRENT_OPLIST(...) \
- CONCURRENTI_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \
+ M_C0NCURRENT_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \
((__VA_ARGS__, M_DEFAULT_OPLIST), \
(__VA_ARGS__ )))
@@ -80,14 +80,14 @@
/* Deferred evaluation for the oplist definition,
so that all arguments are evaluated before further expansion */
-#define CONCURRENTI_OPLIST_P1(arg) CONCURRENTI_OPLIST_P2 arg
+#define M_C0NCURRENT_OPLIST_P1(arg) M_C0NCURRENT_OPLIST_P2 arg
/* Validation of the given oplist */
-#define CONCURRENTI_OPLIST_P2(name, oplist) \
- M_IF_OPLIST(oplist)(CONCURRENTI_OPLIST_P3, CONCURRENTI_OPLIST_FAILURE)(name, oplist)
+#define M_C0NCURRENT_OPLIST_P2(name, oplist) \
+ M_IF_OPLIST(oplist)(M_C0NCURRENT_OPLIST_P3, M_C0NCURRENT_OPLIST_FAILURE)(name, oplist)
/* Prepare a clean compilation failure */
-#define CONCURRENTI_OPLIST_FAILURE(name, oplist) \
+#define M_C0NCURRENT_OPLIST_FAILURE(name, oplist) \
((M_LIB_ERROR(ARGUMENT_OF_CONCURRENT_OPLIST_IS_NOT_AN_OPLIST, name, oplist)))
/* OPLIST definition
@@ -95,7 +95,7 @@
container (_get returns a pointer to an internal data, data that may be
destroyed by another thread).
*/
-#define CONCURRENTI_OPLIST_P3(name, oplist) \
+#define M_C0NCURRENT_OPLIST_P3(name, oplist) \
(M_IF_METHOD(INIT, oplist)(INIT(M_C(name, _init)),) \
,M_IF_METHOD(INIT_SET, oplist)(INIT_SET(M_C(name, _init_set)),) \
,M_IF_METHOD(SET, oplist)(SET(M_C(name, _set)),) \
@@ -135,21 +135,21 @@
/* Internal contract
NOTE: Can't check too much without locking the container itself
*/
-#define CONCURRENTI_CONTRACT(c) do { \
+#define M_C0NCURRENT_CONTRACT(c) do { \
M_ASSERT ((c) != NULL); \
M_ASSERT ( (c)->self == (c)); \
} while (0)
/* Deferred evaluation for the concurrent definition,
so that all arguments are evaluated before further expansion */
-#define CONCURRENTI_DEF_P1(arg) CONCURRENTI_DEF_P2 arg
+#define M_C0NCURRENT_DEF_P1(arg) M_C0NCURRENT_DEF_P2 arg
/* Validate the value oplist before going further */
-#define CONCURRENTI_DEF_P2(name, type, oplist, concurrent_t) \
- M_IF_OPLIST(oplist)(CONCURRENTI_DEF_P3, CONCURRENTI_DEF_FAILURE)(name, type, oplist, concurrent_t)
+#define M_C0NCURRENT_DEF_P2(name, type, oplist, concurrent_t) \
+ M_IF_OPLIST(oplist)(M_C0NCURRENT_DEF_P3, M_C0NCURRENT_DEF_FAILURE)(name, type, oplist, concurrent_t)
/* Stop processing with a compilation failure */
-#define CONCURRENTI_DEF_FAILURE(name, type, oplist, concurrent_t) \
+#define M_C0NCURRENT_DEF_FAILURE(name, type, oplist, concurrent_t) \
M_STATIC_FAILURE(M_LIB_NOT_AN_OPLIST, "(CONCURRENT_DEF): the given argument is not a valid oplist: " M_AS_STR(oplist))
/* Internal concurrent definition
@@ -158,7 +158,7 @@
- oplist: oplist of the type of the sub container
- concurrent_t: alias for M_C(name, _t) [ type of the container ]
*/
-#define CONCURRENTI_DEF_P3(name, type, oplist, concurrent_t) \
+#define M_C0NCURRENT_DEF_P3(name, type, oplist, concurrent_t) \
\
/* Define a concurrent container using a lock */ \
typedef struct M_C(name, _s) { \
@@ -189,7 +189,7 @@
m_mutex_init(out->lock); \
m_cond_init(out->there_is_data); \
out->self = out; \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
\
/* Clear the fields of the concurrent object not associated to the \
@@ -197,7 +197,7 @@
static inline void \
M_C(name, _internal_clear)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_clear(out->lock); \
m_cond_clear(out->there_is_data); \
out->self = NULL; \
@@ -210,7 +210,7 @@
static inline void \
M_C(name, _read_lock)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_lock (out->self->lock); \
} \
\
@@ -220,7 +220,7 @@
static inline void \
M_C(name, _read_unlock)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_unlock (out->self->lock); \
} \
\
@@ -229,7 +229,7 @@
static inline void \
M_C(name, _read_wait)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_cond_wait(out->self->there_is_data, out->self->lock); \
} \
\
@@ -240,7 +240,7 @@
static inline void \
M_C(name, _write_lock)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_lock (out->lock); \
} \
\
@@ -250,7 +250,7 @@
static inline void \
M_C(name, _write_unlock)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_unlock (out->lock); \
} \
\
@@ -259,7 +259,7 @@
static inline void \
M_C(name, _write_wait)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_cond_wait(out->self->there_is_data, out->self->lock); \
} \
\
@@ -268,13 +268,13 @@
static inline void \
M_C(name, _write_signal)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
/* We need to signal this to ALL waiting threads as multiple threads \
may wait on a some data of this container. */ \
m_cond_broadcast(out->there_is_data); \
} \
\
- CONCURRENTI_DEF_FUNC_P3(name, type, oplist, concurrent_t)
+ M_C0NCURRENT_DEF_FUNC_P3(name, type, oplist, concurrent_t)
/* Internal definition of the functions commons to concurrent and rp-concurrent
@@ -285,7 +285,7 @@
A function is defined only if the underlying container exports the needed
services. It is usually one service declared per service exported.
*/
-#define CONCURRENTI_DEF_FUNC_P3(name, type, oplist, concurrent_t) \
+#define M_C0NCURRENT_DEF_FUNC_P3(name, type, oplist, concurrent_t) \
\
M_IF_METHOD(INIT, oplist)( \
static inline void \
@@ -293,7 +293,7 @@
{ \
M_C(name, _internal_init)(out); \
M_CALL_INIT(oplist, out->data); \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
,) \
\
@@ -301,13 +301,13 @@
static inline void \
M_C(name, _init_set)(concurrent_t out, concurrent_t const src) \
{ \
- CONCURRENTI_CONTRACT(src); \
+ M_C0NCURRENT_CONTRACT(src); \
M_ASSERT (out != src); \
M_C(name, _internal_init)(out); \
M_C(name, _read_lock)(src); \
M_CALL_INIT_SET(oplist, out->data, src->data); \
M_C(name, _read_unlock)(src); \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
,) \
\
@@ -315,7 +315,7 @@
static inline void \
M_C(name, _set)(concurrent_t out, concurrent_t const src) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
if (M_UNLIKELY (out == src)) return; \
/* Need to order the locks in a total way to avoid lock deadlock. \
Indeed, two call to _set can be done in two threads with : \
@@ -342,7 +342,7 @@
M_C(name, _write_unlock)(out); \
M_C(name, _read_unlock)(src); \
} \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
,) \
\
@@ -350,7 +350,7 @@
static inline void \
M_C(name, _clear)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
/* No need to lock. A clear is supposed to be called when all operations \
of the container in other threads are terminated */ \
M_CALL_CLEAR(oplist, out->data); \
@@ -362,13 +362,13 @@
static inline void \
M_C(name, _init_move)(concurrent_t out, concurrent_t src) \
{ \
- CONCURRENTI_CONTRACT(src); \
+ M_C0NCURRENT_CONTRACT(src); \
M_ASSERT (out != src); \
/* No need to lock 'src' ? */ \
M_C(name, _internal_init)(out); \
M_CALL_INIT_MOVE(oplist, out->data, src->data); \
M_C(name, _internal_clear)(src); \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
,) \
\
@@ -376,14 +376,14 @@
static inline void \
M_C(name, _move)(concurrent_t out, concurrent_t src) \
{ \
- CONCURRENTI_CONTRACT(out); \
- CONCURRENTI_CONTRACT(src); \
+ M_C0NCURRENT_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(src); \
/* No need to lock 'src' ? */ \
M_C(name, _write_lock)(out); \
M_CALL_MOVE(oplist, out->data, src->data); \
M_C(name, _write_unlock)(out); \
M_C(name, _internal_clear)(src); \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
,) \
\
@@ -391,8 +391,8 @@
static inline void \
M_C(name, _swap)(concurrent_t out, concurrent_t src) \
{ \
- CONCURRENTI_CONTRACT(out); \
- CONCURRENTI_CONTRACT(src); \
+ M_C0NCURRENT_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(src); \
if (M_UNLIKELY (out == src)) return; \
/* See comment above */ \
if (out < src) { \
@@ -417,7 +417,7 @@
static inline void \
M_C(name, _clean)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
M_CALL_CLEAN(oplist, out->data); \
M_C(name, _write_unlock)(out); \
@@ -428,7 +428,7 @@
static inline bool \
M_C(name, _empty_p)(concurrent_t const out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _read_lock)(out); \
bool b = M_CALL_EMPTY_P(oplist, out->data); \
M_C(name, _read_unlock)(out); \
@@ -440,7 +440,7 @@
static inline size_t \
M_C(name, _size)(concurrent_t const out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _read_lock)(out); \
size_t r = M_CALL_GET_SIZE(oplist, out->data); \
M_C(name, _read_unlock)(out); \
@@ -452,7 +452,7 @@
static inline void \
M_C(name, _set_at)(concurrent_t out, M_GET_KEY_TYPE oplist const key, M_GET_VALUE_TYPE oplist const data) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
M_CALL_SET_KEY(oplist, out->data, key, data); \
M_C(name, _write_signal)(out); \
@@ -464,7 +464,7 @@
static inline bool \
M_C(name, _get_copy)(M_GET_VALUE_TYPE oplist *out_data, const concurrent_t out, M_GET_KEY_TYPE oplist const key) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_ASSERT (out_data != NULL); \
M_C(name, _read_lock)(out); \
M_GET_VALUE_TYPE oplist *p = M_CALL_GET_KEY(oplist, out->data, key); \
@@ -480,7 +480,7 @@
static inline void \
M_C(name, _get_at_copy)(M_GET_VALUE_TYPE oplist *out_data, concurrent_t out, M_GET_KEY_TYPE oplist const key) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_ASSERT (out_data != NULL); \
M_C(name, _write_lock)(out); \
M_GET_VALUE_TYPE oplist *p = M_CALL_GET_SET_KEY(oplist, out->data, key); \
@@ -494,7 +494,7 @@
static inline bool \
M_C(name, _erase)(concurrent_t out, M_GET_KEY_TYPE oplist const key) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
bool b = M_CALL_ERASE_KEY(oplist, out->data, key); \
/* We suppose that the container has 'infinite' capacity, so \
@@ -508,7 +508,7 @@
static inline void \
M_C(name, _push)(concurrent_t out, M_GET_SUBTYPE oplist const data) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
M_CALL_PUSH(oplist, out->data, data); \
M_C(name, _write_signal)(out); \
@@ -520,7 +520,7 @@
static inline void \
M_C(name, _pop)(M_GET_SUBTYPE oplist *p, concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
M_CALL_POP(oplist, p, out->data); \
/* See comment above */ \
@@ -532,7 +532,7 @@
static inline void \
M_C(name, _push_move)(concurrent_t out, M_GET_SUBTYPE oplist *data) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
M_CALL_PUSH_MOVE(oplist, out->data, data); \
M_C(name, _write_signal)(out); \
@@ -544,7 +544,7 @@
static inline void \
M_C(name, _pop_move)(M_GET_SUBTYPE oplist *p, concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
M_CALL_POP_MOVE(oplist, p, out->data); \
/* See comment above */ \
@@ -556,7 +556,7 @@
static inline void \
M_C(name, _get_str)(string_t str, concurrent_t const out, bool a) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _read_lock)(out); \
M_CALL_GET_STR(oplist, str, out->data, a); \
M_C(name, _read_unlock)(out); \
@@ -567,7 +567,7 @@
static inline void \
M_C(name, _out_str)(FILE *f, concurrent_t const out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _read_lock)(out); \
M_CALL_OUT_STR(oplist, f, out->data); \
M_C(name, _read_unlock)(out); \
@@ -578,7 +578,7 @@
static inline bool \
M_C(name, _parse_str)(concurrent_t out, const char str[], const char **e) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
bool b = M_CALL_PARSE_STR(oplist, out->data, str, e); \
M_C(name, _write_signal)(out); \
@@ -591,7 +591,7 @@
static inline bool \
M_C(name, _in_str)(concurrent_t out, FILE *f) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
bool b = M_CALL_IN_STR(oplist, out->data, f); \
M_C(name, _write_signal)(out); \
@@ -604,7 +604,7 @@
static inline m_serial_return_code_t \
M_C(name, _out_serial)(m_serial_write_t f, concurrent_t const out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _read_lock)(out); \
m_serial_return_code_t r = M_CALL_OUT_SERIAL(oplist, f, out->data); \
M_C(name, _read_unlock)(out); \
@@ -616,7 +616,7 @@
static inline m_serial_return_code_t \
M_C(name, _in_serial)(concurrent_t out, m_serial_read_t f) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _write_lock)(out); \
m_serial_return_code_t r = M_CALL_IN_SERIAL(oplist, out->data, f); \
M_C(name, _write_signal)(out); \
@@ -629,8 +629,8 @@
static inline bool \
M_C(name, _equal_p)(concurrent_t const out1, concurrent_t const out2) \
{ \
- CONCURRENTI_CONTRACT(out1); \
- CONCURRENTI_CONTRACT(out2); \
+ M_C0NCURRENT_CONTRACT(out1); \
+ M_C0NCURRENT_CONTRACT(out2); \
if (M_UNLIKELY (out1 == out2)) return true; \
/* See comment above on mutal mutexs */ \
if (out1 < out2) { \
@@ -656,7 +656,7 @@
static inline bool \
M_C(name, _get_blocking)(M_GET_VALUE_TYPE oplist *out_data, const concurrent_t out, M_GET_KEY_TYPE oplist const key, bool blocking) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_ASSERT (out_data != NULL); \
bool ret = false; \
M_C(name, _read_lock)(out); \
@@ -680,7 +680,7 @@
static inline bool \
M_C(name, _pop_blocking)(M_GET_SUBTYPE oplist *p, concurrent_t out, bool blocking) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_ASSERT (p != NULL); \
bool ret = false; \
M_C(name, _write_lock)(out); \
@@ -703,7 +703,7 @@
static inline bool \
M_C(name, _pop_move_blocking)(M_GET_SUBTYPE oplist *p, concurrent_t out, bool blocking) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_ASSERT (p != NULL); \
bool ret = false; \
M_C(name, _write_lock)(out); \
@@ -726,7 +726,7 @@
static inline size_t \
M_C(name, _hash)(concurrent_t const out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
M_C(name, _read_lock)(out); \
size_t h = M_CALL_HASH(oplist, out->data); \
M_C(name, _read_unlock)(out); \
@@ -739,14 +739,14 @@
/* Deferred evaluation for the RP concurrent definition,
so that all arguments are evaluated before further expansion */
-#define CONCURRENTI_RP_DEF_P1(arg) CONCURRENTI_RP_DEF_P2 arg
+#define M_C0NCURRENT_RP_DEF_P1(arg) M_C0NCURRENT_RP_DEF_P2 arg
/* Validate the value oplist before going further */
-#define CONCURRENTI_RP_DEF_P2(name, type, oplist, concurrent_t) \
- M_IF_OPLIST(oplist)(CONCURRENTI_RP_DEF_P3, CONCURRENTI_RP_DEF_FAILURE)(name, type, oplist, concurrent_t)
+#define M_C0NCURRENT_RP_DEF_P2(name, type, oplist, concurrent_t) \
+ M_IF_OPLIST(oplist)(M_C0NCURRENT_RP_DEF_P3, M_C0NCURRENT_RP_DEF_FAILURE)(name, type, oplist, concurrent_t)
/* Stop processing with a compilation failure */
-#define CONCURRENTI_RP_DEF_FAILURE(name, type, oplist, concurrent_t) \
+#define M_C0NCURRENT_RP_DEF_FAILURE(name, type, oplist, concurrent_t) \
M_STATIC_FAILURE(M_LIB_NOT_AN_OPLIST, "(CONCURRENT_RP_DEF): the given argument is not a valid oplist: " M_AS_STR(oplist))
/* Internal RP concurrent definition
@@ -755,7 +755,7 @@
- oplist: oplist of the type of the sub container
- concurrent_t: alias for M_C(name, _t) [ type of the container ]
*/
-#define CONCURRENTI_RP_DEF_P3(name, type, oplist, concurrent_t) \
+#define M_C0NCURRENT_RP_DEF_P3(name, type, oplist, concurrent_t) \
\
typedef struct M_C(name, _s) { \
struct M_C(name, _s) *self; \
@@ -782,13 +782,13 @@
out->self = out; \
out->read_count = 0; \
out->writer_waiting = false; \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
} \
\
static inline void \
M_C(name, _internal_clear)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_clear(out->lock); \
m_cond_clear(out->rw_done); \
m_cond_clear(out->there_is_data); \
@@ -798,7 +798,7 @@
static inline void \
M_C(name, _read_lock)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
struct M_C(name, _s) *self = out->self; \
m_mutex_lock (self->lock); \
while (self->writer_waiting == true) { \
@@ -811,7 +811,7 @@
static inline void \
M_C(name, _read_unlock)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
struct M_C(name, _s) *self = out->self; \
m_mutex_lock (self->lock); \
self->read_count --; \
@@ -824,7 +824,7 @@
static inline void \
M_C(name, _write_lock)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_lock (out->lock); \
while (out->writer_waiting == true) { \
m_cond_wait(out->rw_done, out->lock); \
@@ -839,7 +839,7 @@
static inline void \
M_C(name, _write_unlock)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_lock (out->lock); \
out->writer_waiting = false; \
m_cond_broadcast (out->rw_done); \
@@ -849,7 +849,7 @@
static inline void \
M_C(name, _read_wait)(const concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
struct M_C(name, _s) *self = out->self; \
M_ASSERT (self == out); \
m_mutex_lock (out->self->lock); \
@@ -868,7 +868,7 @@
static inline void \
M_C(name, _write_wait)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_lock (out->lock); \
out->writer_waiting = false; \
m_cond_broadcast (out->rw_done); \
@@ -886,13 +886,13 @@
static inline void \
M_C(name, _write_signal)(concurrent_t out) \
{ \
- CONCURRENTI_CONTRACT(out); \
+ M_C0NCURRENT_CONTRACT(out); \
m_mutex_lock (out->lock); \
m_cond_broadcast(out->there_is_data); \
m_mutex_unlock (out->lock); \
} \
\
- CONCURRENTI_DEF_FUNC_P3(name, type, oplist, concurrent_t)
+ M_C0NCURRENT_DEF_FUNC_P3(name, type, oplist, concurrent_t)
#endif