~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_locking.c

  • Committer: Brian Aker
  • Date: 2009-02-05 10:38:55 UTC
  • Revision ID: brian@tangent.org-20090205103855-wajzccrbu7zbvmh4
Reworked some classes out of session.h
Also updated ignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <mystrings/m_ctype.h>
25
25
#include <mysys/my_tree.h>
26
26
#include <mysys/queues.h>
 
27
#include <drizzled/util/test.h>
27
28
 
28
29
        /* lock table by F_UNLCK, F_RDLCK or F_WRLCK */
29
30
 
83
84
        (info->s->nonmmaped_inserts > MAX_NONMAPPED_INSERTS))
84
85
    {
85
86
      if (info->s->concurrent_insert)
86
 
        rw_wrlock(&info->s->mmap_lock);
 
87
        pthread_rwlock_wrlock(&info->s->mmap_lock);
87
88
      mi_remap_file(info, info->s->state.state.data_file_length);
88
89
      info->s->nonmmaped_inserts= 0;
89
90
      if (info->s->concurrent_insert)
90
 
        rw_unlock(&info->s->mmap_lock);
 
91
        pthread_rwlock_unlock(&info->s->mmap_lock);
91
92
    }
92
93
#endif
93
94
          share->state.process= share->last_process=share->this_process;
195
196
        }
196
197
      }
197
198
      _mi_test_if_changed(info);
198
 
        
 
199
 
199
200
      info->lock_type=lock_type;
200
201
      info->invalidator=info->s->invalidator;
201
202
      share->w_locks++;
212
213
    /*
213
214
       Check for bad file descriptors if this table is part
214
215
       of a merge union. Failing to capture this may cause
215
 
       a crash on windows if the table is renamed and 
 
216
       a crash on windows if the table is renamed and
216
217
       later on referenced by the merge table.
217
218
     */
218
219
    if( info->owned_by_merge && (info->s)->kfile < 0 )
307
308
 
308
309
  IMPLEMENTATION
309
310
    Allow concurrent inserts if we don't have a hole in the table or
310
 
    if there is no active write lock and there is active read locks and 
 
311
    if there is no active write lock and there is active read locks and
311
312
    myisam_concurrent_insert == 2. In this last case the new
312
313
    row('s) are inserted at end of file instead of filling up the hole.
313
314