We're nearly there, but there are few things that aren't quite right. I'll do them one at a time.
I think you don't really understand how to pass data to and from the thread function. Let's do that first.
In the thread example I posted, I showed how the thread function can receive and pass information back to the caller thread. We create a struct and share it between both threads. But as we never access the data at the same time from the main thread and a worker thread, we don't need to synchronise access to it. http://www.cplusplus.com/forum/unices/75447/#msg405258
We should use this mechanism to get the counts back from each thread.