Implement a simple thread module.