ThreadPool written in C