Refactor pthread specific and add implementation for Windows