~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/release_lock.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-23 11:44:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110623114430-no355yypk4y3icqb
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
22
 
#include "plugin/user_locks/module.h"
23
 
#include "plugin/user_locks/lock_storage.h"
 
21
#include <config.h>
 
22
#include <plugin/user_locks/module.h>
 
23
#include <plugin/user_locks/lock_storage.h>
24
24
 
25
25
#include <string>
26
26
 
37
37
  }
38
38
  null_value= false;
39
39
 
 
40
  drizzled::identifier::user::ptr user_identifier(getSession().user());
40
41
  drizzled::session_id_t id= getSession().getSessionId();
41
42
  locks::return_t result;
42
43
  {
43
44
    boost::this_thread::restore_interruption dl(getSession().getThreadInterupt());
44
45
    try {
45
 
      result= user_locks::Locks::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()), id);
 
46
      result= user_locks::Locks::getInstance().release(Key(*user_identifier, res->c_str()), id);
46
47
    }
47
48
    catch(boost::thread_interrupted const& error)
48
49
    {
56
57
  default:
57
58
  case locks::SUCCESS:
58
59
    {
59
 
      user_locks::Storable *list= static_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
 
60
      user_locks::Storable *list= getSession().getProperty<user_locks::Storable>("user_locks");
60
61
      assert(list);
61
62
      if (list) // Just in case we ever blow the assert
62
 
        list->erase(Key(getSession().getSecurityContext(), res->c_str()));
 
63
        list->erase(Key(*user_identifier, res->c_str()));
63
64
 
64
65
      return 1;
65
66
    }