When is a record locked?

I failed to find this information on the doc. When is a record locked with a SSD storage? Is the record locked in a transaction thread or in the service thread before entering in the transaction queue?

For SSD storage, it should be on the transaction thread.