~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/barriers.cc

  • Committer: Brian Aker
  • Date: 2010-11-27 09:26:54 UTC
  • mto: This revision was merged to the branch mainline in revision 1956.
  • Revision ID: brian@tangent.org-20101127092654-e3m8yuxal0k346u0
Update such that we can now do a lock test with a wait.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  indeterminate -> barrier was not found.
49
49
 
50
50
*/
51
 
boost::tribool Barriers::release(const user_locks::Key &arg, drizzled::session_id_t owner)
 
51
return_t 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 boost::indeterminate;
 
58
    return NOT_FOUND;
59
59
 
60
60
  if (not (*iter).second->getOwner() == owner)
61
 
    return false;
 
61
    return NOT_OWNED_BY;
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 true;
 
66
  return SUCCESS;
67
67
}
68
68
 
69
69
Barrier::shared_ptr Barriers::find(const user_locks::Key &arg)