Bug #4137 | get_lock does not work | ||
---|---|---|---|
Submitted: | 15 Jun 2004 5:43 | Modified: | 16 Jun 2004 11:35 |
Reporter: | Denis Koykov kdvik | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.0 | OS: | Any (ALL) |
Assigned to: | CPU Architecture: | Any |
[15 Jun 2004 5:43]
Denis Koykov kdvik
[15 Jun 2004 21:02]
Philip
are you using hte same session? try to open to independent connections and obtain the same lock in both of them
[16 Jun 2004 11:30]
Hartmut Holzgraefe
This is expected behavior as locks are taken per session/connection. A GET_LOCK(...) to a lock already held by a session will always succeed and you will get again what you already have. The same is true for IS_LOCK_FREE(...), although its name is a bit misleading here. IS_LOCK_FREE tests if you are able to take a lock using GET_LOCK(...) without delay (unless someone would isse a GET_LOCK(...) inbetween your IS_LOCK_FREE and GET_LOCK calls). AFAIR i originaly suggested the name WOULD_LOCK_SUCCEED for this function.