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 http://dev.mysql.com/doc/mysql/en/miscellaneous-functions.html

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


Subject
Views
Written By
Posted
15050
June 23, 2005 02:34AM
10014
July 06, 2005 07:39AM
Re: How to check if table is locked
17363
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.