~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/release_barrier.cc

  • Committer: patrick crews
  • Date: 2011-06-08 03:02:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2329.
  • Revision ID: gleebix@gmail.com-20110608030227-updkyv2652zvfajc
Initial voodoo worked to give us a crashme mode.  Need docs still

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/barrier_storage.h"
 
21
#include <config.h>
 
22
#include <plugin/user_locks/module.h>
 
23
#include <plugin/user_locks/barrier_storage.h>
24
24
 
25
25
#include <string>
26
26
 
39
39
  }
40
40
 
41
41
 
42
 
  barriers::return_t result= Barriers::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId());
 
42
  drizzled::identifier::user::ptr user_identifier(getSession().user());
 
43
 
 
44
  barriers::return_t result= Barriers::getInstance().release(Key(*user_identifier, res->c_str()), getSession().getSessionId());
43
45
 
44
46
  switch (result)
45
47
  {
46
48
  default:
47
49
  case barriers::SUCCESS:
48
50
    {
49
 
      Storable *list= static_cast<Storable *>(getSession().getProperty(property_key));
 
51
      Storable *list= getSession().getProperty<Storable>(property_key);
50
52
      assert(list);
51
53
      if (not list) // We should have been the owner if it was passed to us, this should never happen
52
54
      {
55
57
 
56
58
        return 0;
57
59
      }
58
 
      list->erase(Key(getSession().getSecurityContext(), res->c_str()));
 
60
      list->erase(Key(*user_identifier, res->c_str()));
59
61
      null_value= false;
60
62
 
61
63
      return 1;