Fully working threading library