CAROLINE-28: Add pthread multithreading implementation.