This function seems better suited in the threading_utils module. Change-Id: Iddd438b57973c7c6c26bd7b6239630656530bd1b