1. A method for accessing a shared resource of a computerized system, the method comprising: running a first portion of a first thread within the computerized system, the first portion (i) requesting a lock on the shared resource and (ii) directing the computerized system to make operations of a second thread visible in a correct order; making operations of the second thread visible in the correct order in response to the first portion of the first thread running within the computerized system; and running a second portion of the first thread within the computerized system to determine whether the first thread has obtained the lock on the shared resource.