~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
23
#include <sys/types.h>
24
24
#include <sys/stat.h>
25
25
#include <fcntl.h>
26
26
 
27
 
#include <drizzled/session.h>
28
 
#include <plugin/myisam/myisam.h>
29
 
#include <drizzled/open_tables_state.h>
30
 
#include <drizzled/plugin/transactional_storage_engine.h>
 
27
#include "drizzled/session.h"
 
28
#include "plugin/myisam/myisam.h"
 
29
#include "drizzled/plugin/transactional_storage_engine.h"
 
30
 
31
31
#include <drizzled/table/instance.h>
32
 
#include <drizzled/table.h>
33
 
#include <drizzled/table_list.h>
34
 
 
35
 
namespace drizzled {
36
 
namespace table {
 
32
 
 
33
#include "drizzled/table.h"
 
34
 
 
35
namespace drizzled
 
36
{
 
37
 
 
38
namespace table
 
39
{
37
40
 
38
41
/*
39
42
  Open table which is already name-locked by this thread.
51
54
  pointer.
52
55
 
53
56
  NOTE
54
 
  This function assumes that its caller already acquired table::Cache::mutex() mutex.
 
57
  This function assumes that its caller already acquired table::Cache::singleton().mutex() mutex.
55
58
 
56
59
  RETURN VALUE
57
60
  false - Success
60
63
 
61
64
bool Concurrent::reopen_name_locked_table(TableList* table_list, Session *session)
62
65
{
63
 
  safe_mutex_assert_owner(table::Cache::mutex().native_handle());
 
66
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
64
67
 
65
68
  if (session->getKilled())
66
69
    return true;
83
86
  getMutableShare()->resetVersion();
84
87
  in_use = session;
85
88
 
86
 
  tablenr= session->open_tables.current_tablenr++;
 
89
  tablenr= session->current_tablenr++;
87
90
  used_fields= 0;
88
91
  const_table= 0;
89
92
  null_row= false;
109
112
 
110
113
  NOTES
111
114
  Extra argument for open is taken from session->open_options
112
 
  One must have a lock on table::Cache::mutex() when calling this function
 
115
  One must have a lock on table::Cache::singleton().mutex() when calling this function
113
116
 
114
117
  RETURN
115
118
  0     ok
124
127
  TableShare::shared_ptr share;
125
128
  uint32_t discover_retry_count= 0;
126
129
 
127
 
  safe_mutex_assert_owner(table::Cache::mutex().native_handle());
 
130
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
128
131
retry:
129
 
  if (not (share= table::instance::Shared::make_shared(session, identifier, error)))
 
132
  if (not (share= table::instance::Shared::make_shared(session,
 
133
                                                       identifier,
 
134
                                                       error)))
130
135
  {
131
136
    return 1;
132
137
  }