~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/create_barrier.cc

  • Committer: Brian Aker
  • Date: 2010-12-02 01:39:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1968.
  • Revision ID: brian@tangent.org-20101202013953-9ie7kafjag0e051q
Style cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
  barriers::Storable *list= static_cast<barriers::Storable *>(getSession().getProperty(barriers::property_key));
42
42
 
43
 
  bool result;
 
43
  boost::tribool result;
44
44
 
45
 
  drizzled::identifier::User::const_shared_ptr user_identifier(getSession().user());
46
45
  if (arg_count == 2)
47
46
  {
48
47
    int64_t wait_for;
49
48
    wait_for= args[1]->val_int();
50
49
 
51
 
    result= Barriers::getInstance().create(Key(*user_identifier, res->c_str()), getSession().getSessionId(), wait_for);
 
50
    result= Barriers::getInstance().create(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId(), wait_for);
52
51
  }
53
52
  else
54
53
  {
55
 
    result= Barriers::getInstance().create(Key(*user_identifier, res->c_str()), getSession().getSessionId());
 
54
    result= Barriers::getInstance().create(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId());
56
55
  }
57
56
 
58
57
 
 
58
  if (boost::indeterminate(result))
 
59
    null_value= true;
 
60
 
59
61
  if (result)
60
62
  {
61
63
    if (not list)
64
66
      getSession().setProperty(barriers::property_key, list);
65
67
    }
66
68
 
67
 
    list->insert(Key(*user_identifier, res->c_str()));
 
69
    list->insert(Key(getSession().getSecurityContext(), res->c_str()));
68
70
 
69
71
    return 1;
70
72
  }