diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2016-05-10 10:51:34 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-05-10 17:13:00 +0000 |
commit | 716d9593497388c48593f818748faf705ac7169e (patch) | |
tree | 50dd1adea16bcff1ab80494532c5603bcf44de5e /vlib/example | |
parent | 46d4e36792e829ef96b43dbc6eec344700d54f13 (diff) |
Avoid clobbering output_function by concurrent CLI sessions doing vlib_process_wait_for_event*.
A problem is easily reproducible by taking the test harness code from the commit,
and launching it in two terminals with some time overlap - the outputs will
be sent to the wrong session. This commit moves the output_function and argument
from a global structure into the process structure, thus the output_function
is not clobbered anymore and each session gets only its own output.
To ensure the callers can redirect the outputs to different destinations
(e.g. the API calls via shared memory, etc.) the existing logic
for vlib_cli_input() was retained.
To avoid the magic numbers usage in the logic that does the page-alignment
of the process stack, there are changes around the stack[] member
of vlib_process_t. Also added a compile-time assert to ensure that
the stack does indeed start on the page size multiple boundary.
Change-Id: I128680ac480735e5f214f81a884e414268e5d652
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'vlib/example')
0 files changed, 0 insertions, 0 deletions