Let's consider the following case:
- a process spawning multiple threads (i.e. multiple device wrappers inside yarprobotinterface).
- each of these threads instantiate its own yarp::os::Node and its own yarp::os::Publisher
- all these publishers write on a topic with the same name.
The process will segfault after a random amount of time, probably due to a race condition inside write() method.
A gist containing a snippet of code to reproduce the bug is provided below.