added blockThread and unblockThread