@David V.: I guess because he needs to know it is locked first? Or maybe he want's to avoid 'touching' the table when/if it is locked? – lexuMar 23 '10 at 13:11
O_O Ooooh my bad, I read that as "delete" (and deleting in the title) locked tables. – David V.Mar 23 '10 at 13:42
You can create your own lock with GET_LOCK(lockName,timeOut)
If you do a GET_LOCK(lockName, 0) with a 0 time out before you lock the tables and then follow that with a RELEASE_LOCK(lockName) then all other threads performing a GET_LOCK() will get a value of 0 which will tell them that the lock is being held by another thread.
However this won't work if you don't have all threads calling GET_LOCK() before locking tables. The documentation for locking tables is here
detecting locked tables mysql (locked by LOCK TABLE)
detecting locked tables mysql (locked by LOCK TABLE)up vote15down votefavorite7I would like to know whether there is an option to detect locked tables in mysql or not...