Updated the performBlockOnMainThread method with a parameter to specify wether or not the calling thread is blocked.