prepare forwarder

This commit is contained in:
Cedric Roux
2016-03-19 23:52:09 +01:00
parent 2bd870afdc
commit ee5d8c60fb
5 changed files with 84 additions and 2 deletions
+13
View File
@@ -115,11 +115,24 @@ extern T_cache_t *T_cache;
#define T_ACTIVE(x) T_active[(intptr_t)x]
#ifdef T_USE_SHARED_MEMORY
#define T_SEND() \
T_cache[T_LOCAL_slot].busy = 1; \
T_cache[T_LOCAL_slot].length = T_LOCAL_size; \
T_send(T_LOCAL_buf, T_LOCAL_size)
#else /* T_USE_SHARED_MEMORY */
/* when not using shared memory, wait for send to finish */
#define T_SEND() \
T_cache[T_LOCAL_slot].busy = 1; \
T_cache[T_LOCAL_slot].length = T_LOCAL_size; \
T_send(T_LOCAL_buf, T_LOCAL_size); \
while (T_cache[T_LOCAL_slot].busy) usleep(1*1000)
#endif /* T_USE_SHARED_MEMORY */
#define T_CHECK_SIZE(len, argnum) \
if (T_LOCAL_size + (len) > T_BUFFER_MAX) { \
printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \