~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/release_lock.cc

  • Committer: Brian Aker
  • Date: 2010-11-30 00:29:39 UTC
  • mto: (1965.2.2 build)
  • mto: This revision was merged to the branch mainline in revision 1966.
  • Revision ID: brian@tangent.org-20101130002939-8bzz3xpa0aapbq2w
Fix sleep() so that a kill command will kill it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
  }
38
38
  null_value= false;
39
39
 
40
 
  drizzled::identifier::User::const_shared_ptr user_identifier(getSession().user());
41
40
  drizzled::session_id_t id= getSession().getSessionId();
42
41
  locks::return_t result;
43
42
  {
44
43
    boost::this_thread::restore_interruption dl(getSession().getThreadInterupt());
45
44
    try {
46
 
      result= user_locks::Locks::getInstance().release(Key(*user_identifier, res->c_str()), id);
 
45
      result= user_locks::Locks::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()), id);
47
46
    }
48
47
    catch(boost::thread_interrupted const& error)
49
48
    {
60
59
      user_locks::Storable *list= static_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
61
60
      assert(list);
62
61
      if (list) // Just in case we ever blow the assert
63
 
        list->erase(Key(*user_identifier, res->c_str()));
 
62
        list->erase(Key(getSession().getSecurityContext(), res->c_str()));
64
63
 
65
64
      return 1;
66
65
    }