|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libndp should be thread safe. That doesn't mean, that one "struct ndp"
can be used by multiple threads without locking. But it should be
reasonably possible to use the library in a multi threaded scenario.
Some API functions return values that are cached in static variables.
That makes these function (and the entire library) not thread safe.
Fix that by using gcc's __thread specifier for thread local storage.
This is also supported by clang.
Currently, it's not clear whether all compiler that libndp supports,
support this. I expect that to be the case. Hence, the NDP_THREAD define
does not try to workaround such (yet unknown) build environments. However,
if the need arises, we can easily extend the NDP_THREAD define with some
conditional compilation.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
|