Comment 2 for bug 885802

Revision history for this message
Andrew Johnson (anj) wrote :

Yes, the warnings still occur because the code is passing a series of template functions (which must have C++ linkage) to the routine epicsThreadCreate() that wants a pointer to a function with C linkage.

I have a solution (attached), which is to add a new C++-only epicsThreadCreateCpp() API that takes a function pointer with C++ linkage and arranges for it to be called properly in the new thread. For completeness it also catches any exceptions thrown in the target thread, and converts thread-creation failures into exceptions (instead of returning a NULL epicsThreadId).

Any objections to my adding this?