linux only fix which adds a thread safe version of getprotocolbyname. Sadly one of those functions which not all OS's support.

Hi all,

I was attempting to run MOOS on a slower omap processor and encountered
a race condition between threads in the MOOSDB.  The result is that the
tcp server in the MOOSCommServer would be set as UDP instead of TCP
resulting in the listen call continuously throwing an 'operation not
supported' exception and putting the MOOSDB into a busy loop.

I traced the problem to the non-threadsafe getprotobyname and
getprotobynumber calls in
core-moos/Core/libMOOS/Comms/XPCGetProtocol.cpp.  The solution is to
change the calls to the thread-safe reentrant versions, getprotobyname_r
and get getprotobynumber_r.  The Linux Man page for getprotobyname_r
provides a good example of the changes necessary.

I don't have any questions, just providing a heads up in case anyone
encounters this issue before it's fixed on trunk.

Thanks,
-Mark

-------------

Mark Moseley
Pr. Robotics Software Engineer
iRobot Corporation
8 Crosby Drive, M/S 8-1
Bedford, MA 01730
(781) 430-3537