In some processor's microarchitecture, there's an atomic operation for test and set, such that a bit can be tested (the results stored) and the bit set, all guaranteed without interruption, for the purpose of process synchronization.
How can i have a MySQL bit to indicate that a record is locked for editing, and thus at the beginning of the code that does the editing, i do a test and set, and deny entry into the critical code region if the bit was found to have been already set, else set it and proceed into the critical code section.
i can approximate this with two adjacent statements,
SELECT bit FROM....
UPDATE ... SET bit=1
but surely there is a built-in way to guarantee no intervening interruption btwn the two queries.