Added code documentation

Added necessary comments to the ThreadPool class.