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
Hope that helps!
answered 2010-03-31T11:07:03.560