~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/lock.cc

  • Committer: Brian Aker
  • Date: 2009-05-12 03:22:59 UTC
  • mfrom: (1008.1.1 merge)
  • Revision ID: brian@gaz-20090512032259-koqm71phusfj5ntd
Merging Brian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
489
489
  }
490
490
}
491
491
 
492
 
/* Downgrade all locks on a table to new WRITE level from WRITE_ONLY */
493
 
 
494
 
void mysql_lock_downgrade_write(Session *session, Table *table,
495
 
                                thr_lock_type new_lock_type)
496
 
{
497
 
  DRIZZLE_LOCK *locked;
498
 
  Table *write_lock_used;
499
 
  if ((locked = get_lock_data(session, &table, 1, GET_LOCK_UNLOCK,
500
 
                              &write_lock_used)))
501
 
  {
502
 
    for (uint32_t i=0; i < locked->lock_count; i++)
503
 
      thr_downgrade_write_lock(locked->locks[i], new_lock_type);
504
 
    free((unsigned char*) locked);
505
 
  }
506
 
}
507
 
 
508
492
 
509
493
/** Abort all other threads waiting to get lock in table. */
510
494