Added locked_ptr and synchronized to provide automatic locking for pointers.