~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.cc

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2010-05-06 14:23:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1544.
  • Revision ID: barry.leslie@primebase.com-20100506142327-hg5wnvqgn5bc6lw3
Renamed the 'Event' plugin to 'EventObserver' plugin along with some internal class renames to make things clearer.
Unless I really need a pointer to an object I now always pass things by reference.
'Post' event observers can now report a failure the same as 'Pre' event observers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include "drizzled/sql_base.h"
36
36
#include "drizzled/pthread_globals.h"
37
37
#include "drizzled/internal/my_pthread.h"
38
 
#include "drizzled/plugin/event.h"
 
38
#include "drizzled/plugin/event_observer.h"
39
39
 
40
40
using namespace std;
41
41
 
110
110
    const string key_string(share->table_cache_key.str,
111
111
                            share->table_cache_key.length);
112
112
                            
113
 
    plugin::Event::deregisterTableEventsDo(share);
 
113
    plugin::EventObserver::deregisterTableEventsDo(*share);
114
114
   
115
115
    TableDefinitionCache::iterator iter= table_def_cache.find(key_string);
116
116
    if (iter != table_def_cache.end())
135
135
    if (share->ref_count == 0)
136
136
    {
137
137
      pthread_mutex_lock(&share->mutex);
138
 
      plugin::Event::deregisterTableEventsDo(share);
 
138
      plugin::EventObserver::deregisterTableEventsDo(*share);
139
139
      share->free_table_share();
140
140
      table_def_cache.erase(key_string);
141
141
    }
239
239
  }
240
240
  share->ref_count++;                           // Mark in use
241
241
  
242
 
  plugin::Event::registerTableEventsDo(share);
 
242
  plugin::EventObserver::registerTableEventsDo(*share);
243
243
  
244
244
  (void) pthread_mutex_unlock(&share->mutex);
245
245