Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Clean up dead API client reaper callack scheme
[vpp.git]
/
src
/
vlibapi
/
vat_helper_macros.h
diff --git
a/src/vlibapi/vat_helper_macros.h
b/src/vlibapi/vat_helper_macros.h
index
ffb74fe
..
57ad520
100644
(file)
--- a/
src/vlibapi/vat_helper_macros.h
+++ b/
src/vlibapi/vat_helper_macros.h
@@
-42,32
+42,34
@@
do { \
#define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
/* W: wait for results, with timeout */
#define S(mp) (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
/* W: wait for results, with timeout */
-#define W
\
+#define W
(ret)
\
do { \
f64 timeout = vat_time_now (vam) + 1.0; \
do { \
f64 timeout = vat_time_now (vam) + 1.0; \
+ ret = -99; \
\
while (vat_time_now (vam) < timeout) { \
if (vam->result_ready == 1) { \
\
while (vat_time_now (vam) < timeout) { \
if (vam->result_ready == 1) { \
- return (vam->retval); \
+ ret = vam->retval; \
+ break; \
} \
vat_suspend (vam->vlib_main, 1e-5); \
} \
} \
vat_suspend (vam->vlib_main, 1e-5); \
} \
- return -99; \
} while(0);
/* W2: wait for results, with timeout */
} while(0);
/* W2: wait for results, with timeout */
-#define W2(
body)
\
+#define W2(
ret, body)
\
do { \
f64 timeout = vat_time_now (vam) + 1.0; \
do { \
f64 timeout = vat_time_now (vam) + 1.0; \
+ ret = -99; \
\
while (vat_time_now (vam) < timeout) { \
if (vam->result_ready == 1) { \
(body); \
\
while (vat_time_now (vam) < timeout) { \
if (vam->result_ready == 1) { \
(body); \
- return (vam->retval); \
+ ret = vam->retval; \
+ break; \
} \
vat_suspend (vam->vlib_main, 1e-5); \
} \
} \
vat_suspend (vam->vlib_main, 1e-5); \
} \
- return -99; \
} while(0);
} while(0);