~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-13 01:22:19 UTC
  • mto: (1126.9.2 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090913012219-cjc1r8o2p6c5ohx9
Added calls to the dtrace probes related to locks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2692
2692
  */
2693
2693
  assert(next_insert_id == 0);
2694
2694
 
 
2695
  if (DRIZZLE_HANDLER_RDLOCK_START_ENABLED() ||
 
2696
      DRIZZLE_HANDLER_WRLOCK_START_ENABLED() ||
 
2697
      DRIZZLE_HANDLER_UNLOCK_START_ENABLED())
 
2698
  {
 
2699
    if (lock_type == F_RDLCK)
 
2700
    {
 
2701
      DRIZZLE_EXTERNAL_RDLOCK_START(table_share->db.str,
 
2702
                                    table_share->table_name.str);
 
2703
    }
 
2704
    else if (lock_type == F_WRLCK)
 
2705
    {
 
2706
      DRIZZLE_EXTERNAL_WRLOCK_START(table_share->db.str,
 
2707
                                    table_share->table_name.str);
 
2708
    }
 
2709
    else if (lock_type == F_UNLCK)
 
2710
    {
 
2711
      DRIZZLE_EXTERNAL_UNLOCK_START(table_share->db.str,
 
2712
                                    table_share->table_name.str);
 
2713
    }
 
2714
  }
 
2715
 
2695
2716
  /*
2696
2717
    We cache the table flags if the locking succeeded. Otherwise, we
2697
2718
    keep them as they were when they were fetched in ha_open().
2698
2719
  */
2699
 
  DRIZZLE_EXTERNAL_LOCK(lock_type);
2700
2720
 
2701
2721
  int error= external_lock(session, lock_type);
 
2722
 
 
2723
  if (DRIZZLE_HANDLER_RDLOCK_DONE_ENABLED() ||
 
2724
      DRIZZLE_HANDLER_WRLOCK_DONE_ENABLED() ||
 
2725
      DRIZZLE_HANDLER_UNLOCK_DONE_ENABLED())
 
2726
  {
 
2727
    if (lock_type == F_RDLCK)
 
2728
    {
 
2729
      DRIZZLE_EXTERNAL_RDLOCK_DONE(table_share->db.str,
 
2730
                                   table_share->table_name.str);
 
2731
    }
 
2732
    else if (lock_type == F_WRLCK)
 
2733
    {
 
2734
      DRIZZLE_EXTERNAL_WRLOCK_DONE(table_share->db.str,
 
2735
                                   table_share->table_name.str);
 
2736
    }
 
2737
    else if (lock_type == F_UNLCK)
 
2738
    {
 
2739
      DRIZZLE_EXTERNAL_UNLOCK_DONE(table_share->db.str,
 
2740
                                   table_share->table_name.str);
 
2741
    }
 
2742
  }
2702
2743
  if (error == 0)
2703
2744
    cached_table_flags= table_flags();
2704
2745
  return error;