~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: Brian Aker
  • Date: 2010-11-06 15:43:10 UTC
  • mfrom: (1908.1.1 merge)
  • Revision ID: brian@tangent.org-20101106154310-g1jpjzwbc53pfc4f
Filesort encapsulation, plus modification to copy contructor

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