If it's only called from a thread, your second one is fine.
The cast isn't necessary because xx is void*