This is not a preemptive threads system, however adding preemption can be done in the same way as the CSE 451 threads package. You can use the signal and kill system calls to register an interrupt handler and send an interrupt respectively. The setitimer system call can be used to set a timer to send your process an interrupt at any given interval.
Here are the source files:
This threads package has been debugged on Linux it is not guarenteed to work on any other platform. However, it should work or be easily modified to work on any UNIX platform. It does not rely on any architecture dependent assembly.