So, your main does some initialisation, creates a bunch of threads, then does some cleanup, and then immediately terminates.
When exactly were you planning on having it wait for the threads to do...