~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:30:44 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103033044-10ctxt43f0yhm4v2
fix docs warning: underline/overline too short for update.rst

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
  pointer.
53
53
 
54
54
  NOTE
55
 
  This function assumes that its caller already acquired table::Cache::singleton().mutex() mutex.
 
55
  This function assumes that its caller already acquired LOCK_open mutex.
56
56
 
57
57
  RETURN VALUE
58
58
  false - Success
61
61
 
62
62
bool Concurrent::reopen_name_locked_table(TableList* table_list, Session *session)
63
63
{
64
 
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
 
64
  safe_mutex_assert_owner(LOCK_open.native_handle());
65
65
 
66
 
  if (session->getKilled())
 
66
  if (session->killed)
67
67
    return true;
68
68
 
69
69
  TableIdentifier identifier(table_list->getSchemaName(), table_list->getTableName());
110
110
 
111
111
  NOTES
112
112
  Extra argument for open is taken from session->open_options
113
 
  One must have a lock on table::Cache::singleton().mutex() when calling this function
 
113
  One must have a lock on LOCK_open when calling this function
114
114
 
115
115
  RETURN
116
116
  0     ok
122
122
                                         TableIdentifier &identifier)
123
123
{
124
124
  int error;
125
 
  TableShare::shared_ptr share;
 
125
  TableSharePtr share;
126
126
  uint32_t discover_retry_count= 0;
127
127
 
128
 
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
 
128
  safe_mutex_assert_owner(LOCK_open.native_handle());
129
129
retry:
130
130
  if (not (share= TableShare::getShareCreate(session,
131
131
                                             identifier,
132
 
                                             error)))
133
 
  {
 
132
                                             &error)))
134
133
    return 1;
135
 
  }
136
134
 
137
135
  while ((error= share->open_table_from_share(session,
138
136
                                              identifier,
179
177
      /* Free share and wait until it's released by all threads */
180
178
      TableShare::release(share);
181
179
 
182
 
      if (not session->getKilled())
 
180
      if (!session->killed)
183
181
      {
184
182
        drizzle_reset_errors(session, 1);         // Clear warnings
185
183
        session->clear_error();                 // Clear error message
196
194
  return 0;
197
195
}
198
196
 
199
 
void table::Concurrent::release(void)
200
 
{
201
 
  // During an ALTER TABLE we could see the proto go away when the
202
 
  // definition is pushed out of this table object. In this case we would
203
 
  // not release from the cache because we were not in the cache. We just
204
 
  // delete if this happens.
205
 
  if (getShare()->getType() == message::Table::STANDARD)
206
 
  {
207
 
    TableShare::release(getMutableShare());
208
 
  }
209
 
  else
210
 
  {
211
 
    delete _share;
212
 
  }
213
 
  _share= NULL;
214
 
}
215
 
 
216
197
} /* namespace table */
217
198
} /* namespace drizzled */