Added thread functions for Win32. Win32 builds again