Added thread file to hal. To be renamed later