Updated KiSelectFairThread and implemented a basic tree synchronisation function