1. A computer-implemented method for implementing a safepoint for a thread, comprising: during compilation of an application to be executed by the thread: obtaining a register to be associated with the thread; inserting safepoint code into the application, wherein the safepoint code includes an indirect load from a memory location stored in the register to the register; and during execution of the application by the thread, writing a thread-specific value for the thread to the register, wherein the thread-specific value corresponds to an enabled value, a triggered value, or a disabled value, wherein executing the indirect load by the thread causes the thread to trap if the thread-specific value corresponds to the triggered value.