22 #include <plugin/user_locks/module.h>
23 #include <plugin/user_locks/barrier_storage.h>
33 int64_t wait_until= args[1]->
val_int();
35 if (res and res->length() and wait_until)
37 Barrier::shared_ptr barrier= Barriers::getInstance().find(
Key(*getSession().user(), res->c_str()));
39 if (barrier and barrier->getOwner() == getSession().
getSessionId())
41 my_error(drizzled::ER_USER_LOCKS_CANT_WAIT_ON_OWN_BARRIER, MYF(0));
47 boost::this_thread::restore_interruption dl(getSession().getThreadInterupt());
49 barrier->wait_until(wait_until);
51 catch(boost::thread_interrupted
const&)
54 my_error(drizzled::ER_QUERY_INTERRUPTED, MYF(0));
63 else if (not res || not res->length())
65 my_error(drizzled::ER_USER_LOCKS_INVALID_NAME_BARRIER, MYF(0));
69 my_error(drizzled::ER_USER_LOCKS_UNKNOWN_BARRIER, MYF(0));
virtual int64_t val_int()=0
session_id_t getSessionId() const
virtual String * val_str(String *str)=0