Placed the pthread-related structures and functions inside an anonymous
namespace to prevent a "multiple definition" compilation error.