Some fixes. Possbily finished work on the thread_Create function. ALso changed the lock to use the atomic xchg function provided by the x86.h file.