a simple thread library