MySQL Forums
Forum List  »  InnoDB

Re: How to check if table is locked
Posted by: KimSeong Loh
Date: July 06, 2005 07:48PM

You can create a user defined lock with GET_LOCK(str,timeout), see

Do a get_lock with timeout 0, before your LOCK TABLE and release_lock after your UNLOCK TABLES.
Another thread running the get_lock will return a value 0 to indicate the locks is being held by another thread.

You have to be consistant to make this work, and it will not work if any thread LOCK TABLES without calling get_lock first.

Options: ReplyQuote

Written By
June 23, 2005 02:34AM
July 06, 2005 07:39AM
Re: How to check if table is locked
July 06, 2005 07:48PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.