~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/lock.cc

  • Committer: Brian Aker
  • Date: 2010-08-13 18:47:12 UTC
  • mfrom: (1703.1.4 staging)
  • Revision ID: brian@tangent.org-20100813184712-rx8hjq33powaaqlv
Merge MyISAM changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
773
773
      result=1;
774
774
      break;
775
775
    }
776
 
    session->wait_for_condition(LOCK_open.native_handle(), COND_refresh.native_handle());
 
776
    session->wait_for_condition(LOCK_open, COND_refresh);
777
777
    LOCK_open.lock(); /* Wait for a table to unlock and then lock it */
778
778
  }
779
779
  return result;
1006
1006
  {
1007
1007
    const char *old_message;
1008
1008
    LOCK_global_read_lock.lock();
1009
 
    old_message=session->enter_cond(COND_global_read_lock.native_handle(), LOCK_global_read_lock.native_handle(),
 
1009
    old_message=session->enter_cond(COND_global_read_lock, LOCK_global_read_lock,
1010
1010
                                "Waiting to get readlock");
1011
1011
 
1012
1012
    waiting_for_read_lock++;
1087
1087
      */
1088
1088
      return is_not_commit;
1089
1089
    }
1090
 
    old_message=session->enter_cond(COND_global_read_lock.native_handle(), LOCK_global_read_lock.native_handle(),
1091
 
                                "Waiting for release of readlock");
 
1090
    old_message=session->enter_cond(COND_global_read_lock, LOCK_global_read_lock,
 
1091
                                    "Waiting for release of readlock");
1092
1092
    while (must_wait(is_not_commit) && ! session->killed &&
1093
1093
           (!abort_on_refresh || session->version == refresh_version))
1094
1094
    {
1139
1139
  LOCK_global_read_lock.lock();
1140
1140
  /* increment this BEFORE waiting on cond (otherwise race cond) */
1141
1141
  global_read_lock_blocks_commit++;
1142
 
  old_message= session->enter_cond(COND_global_read_lock.native_handle(), LOCK_global_read_lock.native_handle(),
1143
 
                               "Waiting for all running commits to finish");
 
1142
  old_message= session->enter_cond(COND_global_read_lock, LOCK_global_read_lock,
 
1143
                                   "Waiting for all running commits to finish");
1144
1144
  while (protect_against_global_read_lock && !session->killed)
1145
1145
    pthread_cond_wait(COND_global_read_lock.native_handle(), LOCK_global_read_lock.native_handle());
1146
1146
  if ((error= test(session->killed)))
1173
1173
 
1174
1174
void broadcast_refresh(void)
1175
1175
{
1176
 
  pthread_cond_broadcast(COND_refresh.native_handle());
 
1176
  COND_refresh.notify_all();
1177
1177
  COND_global_read_lock.notify_all();
1178
1178
}
1179
1179