How to pass parameters into a thread function

See