~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: Brian Aker
  • Date: 2011-01-13 07:03:39 UTC
  • mfrom: (2077.1.3 drizzle)
  • Revision ID: brian@gir-3-20110113070339-bnfp4yvngb6frhru
Merge in all of the fixes for definition to instance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "plugin/myisam/myisam.h"
29
29
#include "drizzled/plugin/transactional_storage_engine.h"
30
30
 
 
31
#include <drizzled/table/instance.h>
 
32
 
31
33
#include "drizzled/table.h"
32
34
 
33
35
namespace drizzled
127
129
 
128
130
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
129
131
retry:
130
 
  if (not (share= TableShare::getShareCreate(session,
131
 
                                             identifier,
132
 
                                             error)))
 
132
  if (not (share= table::instance::Shared::make_shared(session,
 
133
                                                       identifier,
 
134
                                                       error)))
133
135
  {
134
136
    return 1;
135
137
  }
148
150
      share->resetVersion();                        // Mark share as old
149
151
      if (discover_retry_count++)               // Retry once
150
152
      {
151
 
        TableShare::release(share);
 
153
        table::instance::release(share);
152
154
        return 1;
153
155
      }
154
156
 
173
175
      */
174
176
      if (share->getTableCount() != 1)
175
177
      {
176
 
        TableShare::release(share);
 
178
        table::instance::release(share);
177
179
        return 1;
178
180
      }
 
181
 
179
182
      /* Free share and wait until it's released by all threads */
180
 
      TableShare::release(share);
 
183
      table::instance::release(share);
181
184
 
182
185
      if (not session->getKilled())
183
186
      {
185
188
        session->clear_error();                 // Clear error message
186
189
        goto retry;
187
190
      }
 
191
 
188
192
      return 1;
189
193
    }
190
194
 
191
 
    TableShare::release(share);
 
195
    table::instance::release(share);
192
196
 
193
197
    return 1;
194
198
  }
204
208
  // delete if this happens.
205
209
  if (getShare()->getType() == message::Table::STANDARD)
206
210
  {
207
 
    TableShare::release(getMutableShare());
 
211
    table::instance::release(getMutableShare());
208
212
  }
209
213
  else
210
214
  {