~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2010-09-28 06:27:36 UTC
  • mto: (1800.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 1801.
  • Revision ID: brian@tangent.org-20100928062736-65a8ufnsji93fd99
Remove additional (maybe last of?) native_handle actual calls (safe_mutex is
historical and unused, so it does not count).

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
  You should have received a copy of the GNU General Public License
13
13
  along with this program; if not, write to the Free Software
14
 
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
17
17
/* Basic functions needed by many modules */
456
456
                                                     (table->open_placeholder && wait_for_placeholders)))
457
457
          {
458
458
            found= true;
459
 
            boost_unique_lock_t scoped(LOCK_open, boost::adopt_lock_t());
 
459
            boost::mutex::scoped_lock scoped(LOCK_open, boost::adopt_lock_t());
460
460
            COND_refresh.wait(scoped);
461
461
            scoped.release();
462
462
            break;
487
487
 
488
488
  if (wait_for_refresh)
489
489
  {
490
 
    boost_unique_lock_t scopedLock(session->mysys_var->mutex);
 
490
    boost::mutex::scoped_lock scopedLock(session->mysys_var->mutex);
491
491
    session->mysys_var->current_mutex= 0;
492
492
    session->mysys_var->current_cond= 0;
493
493
    session->set_proc_info(0);
551
551
 
552
552
  safe_mutex_assert_not_owner(LOCK_open.native_handle());
553
553
 
554
 
  boost_unique_lock_t scoped_lock(LOCK_open); /* Close all open tables on Session */
 
554
  boost::mutex::scoped_lock scoped_lock(LOCK_open); /* Close all open tables on Session */
555
555
 
556
556
  while (open_tables)
557
557
  {
918
918
  }
919
919
  else
920
920
  {
921
 
    boost_unique_lock_t scoped_lock(LOCK_open); /* Close and drop a table (AUX routine) */
 
921
    boost::mutex::scoped_lock scoped_lock(LOCK_open); /* Close and drop a table (AUX routine) */
922
922
    /*
923
923
      unlink_open_table() also tells threads waiting for refresh or close
924
924
      that something has happened.
940
940
  cond  Condition to wait for
941
941
*/
942
942
 
943
 
void Session::wait_for_condition(boost::mutex &mutex, boost::condition_variable_any &cond)
 
943
void Session::wait_for_condition(boost::mutex &mutex, boost::condition_variable &cond)
944
944
{
945
945
  /* Wait until the current table is up to date */
946
946
  const char *saved_proc_info;
959
959
      condition variables that are guranteed to not disapper (freed) even if this
960
960
      mutex is unlocked
961
961
    */
962
 
    boost_unique_lock_t scopedLock(mutex, boost::adopt_lock_t());
 
962
    boost::mutex::scoped_lock scopedLock(mutex, boost::adopt_lock_t());
963
963
    if (not killed)
964
964
    {
965
965
      cond.wait(scopedLock);
966
966
    }
967
967
  }
968
 
  boost_unique_lock_t mysys_scopedLock(mysys_var->mutex);
 
968
  boost::mutex::scoped_lock (mysys_var->mutex);
969
969
  mysys_var->current_mutex= 0;
970
970
  mysys_var->current_cond= 0;
971
971
  set_proc_info(saved_proc_info);
1120
1120
{
1121
1121
  const TableIdentifier::Key &key(identifier.getKey());
1122
1122
 
1123
 
  boost_unique_lock_t scope_lock(LOCK_open); /* Obtain a name lock even though table is not in cache (like for create table)  */
 
1123
  boost::mutex::scoped_lock scope_lock(LOCK_open); /* Obtain a name lock even though table is not in cache (like for create table)  */
1124
1124
 
1125
1125
  TableOpenCache::iterator iter;
1126
1126
 
1455
1455
  }
1456
1456
  assert(table->getShare()->getTableCount() > 0 || table->getShare()->getType() != message::Table::STANDARD);
1457
1457
 
 
1458
  if (lex->need_correct_ident())
 
1459
    table->alias_name_used= my_strcasecmp(table_alias_charset,
 
1460
                                          table->getMutableShare()->getTableName(), alias);
1458
1461
  /* Fix alias if table name changes */
1459
1462
  if (strcmp(table->getAlias(), alias))
1460
1463
  {
1764
1767
 
1765
1768
  session->set_proc_info("Waiting for tables");
1766
1769
  {
1767
 
    boost_unique_lock_t lock(LOCK_open);
 
1770
    boost::mutex::scoped_lock lock(LOCK_open);
1768
1771
    while (!session->killed)
1769
1772
    {
1770
1773
      session->some_tables_deleted= false;
2316
2319
{
2317
2320
  if (session->mark_used_columns != MARK_COLUMNS_NONE)
2318
2321
  {
2319
 
    boost::dynamic_bitset<> *current_bitmap= NULL;
 
2322
    MyBitmap *current_bitmap, *other_bitmap;
2320
2323
 
2321
2324
    /*
2322
2325
      We always want to register the used keys, as the column bitmap may have
2329
2332
    if (session->mark_used_columns == MARK_COLUMNS_READ)
2330
2333
    {
2331
2334
      current_bitmap= table->read_set;
 
2335
      other_bitmap=   table->write_set;
2332
2336
    }
2333
2337
    else
2334
2338
    {
2335
2339
      current_bitmap= table->write_set;
 
2340
      other_bitmap=   table->read_set;
2336
2341
    }
2337
2342
 
2338
 
    //if (current_bitmap->testAndSet(field->field_index))
2339
 
    if (current_bitmap->test(field->field_index))
 
2343
    if (current_bitmap->testAndSet(field->field_index))
2340
2344
    {
2341
2345
      if (session->mark_used_columns == MARK_COLUMNS_WRITE)
2342
2346
        session->dup_field= field;
4505
4509
        dropping_tables++;
4506
4510
        if (likely(signalled))
4507
4511
        {
4508
 
          boost_unique_lock_t scoped(LOCK_open, boost::adopt_lock_t());
 
4512
          boost::mutex::scoped_lock scoped(LOCK_open, boost::adopt_lock_t());
4509
4513
          COND_refresh.wait(scoped);
4510
4514
          scoped.release();
4511
4515
        }
4524
4528
          boost::xtime xt; 
4525
4529
          xtime_get(&xt, boost::TIME_UTC); 
4526
4530
          xt.sec += 10; 
4527
 
          boost_unique_lock_t scoped(LOCK_open, boost::adopt_lock_t());
 
4531
          boost::mutex::scoped_lock scoped(LOCK_open, boost::adopt_lock_t());
4528
4532
          COND_refresh.timed_wait(scoped, xt);
4529
4533
          scoped.release();
4530
4534
        }