Merge "Removed duplicate code in threading.c"