vppinfra: Expose function setting __os_thread_index 29/21029/3
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>
Thu, 1 Aug 2019 16:14:06 +0000 (18:14 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Fri, 2 Aug 2019 16:49:01 +0000 (16:49 +0000)
commitd516ca42d3fcbdc5da9877ab07298f8bb891bff3
treee351bfa07a58042552e9424776b022d7fae25aed
parentedfe0eea7a938e650074fcb82a971187a7beb12e
vppinfra: Expose function setting __os_thread_index

Type: feature

This is needed when creating pthreads in client applications,
they need a way to set __os_thread_index per thread
that does not conflict with the binary API thread index.

If __os_thread_index is left to 0 in two client pthreads and
they call vl_msg_api_alloc and vec_resize at the same time
it can fail due to them sharing (and push/poping) the same
clib_per_cpu_mheaps slot.

Change-Id: I85d4248a39b641a4d3ad5a1c1bd6e0db5875fab6
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
src/vlibmemory/memory_client.c
src/vppinfra/mem.h
src/vppinfra/os.h