fix signatures of functions for threads.

Here is the potential probem with the calling convention.