~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/locks.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704191147-s99ojek811zi1fzj
RemoveĀ unusedĀ Name_resolution_context::error_reporter

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"
 
21
#include <config.h>
 
22
#include <plugin/user_locks/module.h>
23
23
 
24
24
#include <boost/thread/locks.hpp>
25
25
 
35
35
  LockMap::iterator iter;
36
36
  while ((iter= lock_map.find(arg)) != lock_map.end())
37
37
  {
38
 
    if (id_arg == (*iter).second->id)
 
38
    if (id_arg == iter->second->id)
39
39
    {
40
40
      // We own the lock, so we just exit.
41
41
      return true;
75
75
{
76
76
  boost::unique_lock<boost::mutex> scope(mutex);
77
77
  boost::system_time timeout= boost::get_system_time() + boost::posix_time::seconds(wait_for);
78
 
  bool timed_out;
79
78
 
80
79
  try {
81
 
    timed_out= create_cond.timed_wait(scope, timeout);
 
80
    create_cond.timed_wait(scope, timeout);
82
81
  }
83
82
  catch(boost::thread_interrupted const& error)
84
83
  {
137
136
  if ( iter == lock_map.end())
138
137
    return false;
139
138
 
140
 
  id_arg= (*iter).second->id;
 
139
  id_arg= iter->second->id;
141
140
 
142
141
  return true;
143
142
}
167
166
  if ( iter == lock_map.end())
168
167
    return locks::NOT_FOUND;
169
168
 
170
 
  if ((*iter).second->id == id_arg)
 
169
  if (iter->second->id == id_arg)
171
170
  {
172
171
    elements= lock_map.erase(arg);
173
172
    assert(elements); // If we can't find what we just found, then we are broken