~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/barriers.cc

  • Committer: Lee Bieber
  • Date: 2010-11-20 22:04:04 UTC
  • mfrom: (1942.1.4 b)
  • Revision ID: kalebral@gmail.com-20101120220404-2qpb4xuik9wv9u1q
Merge Lee -  Run bzr ignore for leftover files
Merge Shrews - Add a --replicate-query option to the server which controls whether or not the SQL query string is included in the GPB Statement messages.
Merge Andrew - fix bug 665119: drizzleslap has -i mapped to two options
Merge Andrew fix bug 674145: Table Names Not Case Matched

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  indeterminate -> barrier was not found.
49
49
 
50
50
*/
51
 
return_t Barriers::release(const user_locks::Key &arg, drizzled::session_id_t owner)
 
51
boost::tribool Barriers::release(const user_locks::Key &arg, drizzled::session_id_t owner)
52
52
{
53
53
  boost::unique_lock<boost::mutex> scope(mutex);
54
54
  Map::iterator iter= barrier_map.find(arg);
55
55
 
56
56
  // Nothing is found
57
57
  if ( iter == barrier_map.end())
58
 
    return NOT_FOUND;
 
58
    return boost::indeterminate;
59
59
 
60
60
  if (not (*iter).second->getOwner() == owner)
61
 
    return NOT_OWNED_BY;
 
61
    return false;
62
62
 
63
63
  (*iter).second->signal(); // We tell anyone left to start running
64
64
  (void)barrier_map.erase(arg);
65
65
 
66
 
  return SUCCESS;
 
66
  return true;
67
67
}
68
68
 
69
69
Barrier::shared_ptr Barriers::find(const user_locks::Key &arg)