Initializes the pipe.
Must be called after the thread count has been set and tasks have been added to the pipe.