~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-20 22:48:37 UTC
  • Revision ID: brian@tangent.org-20090220224837-fw5wrf46n4ru3e6a
First pass of stripping uint

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
 
      info->invalidator=info->s->invalidator;
201
201
      share->w_locks++;
202
202
      share->tot_locks++;
203
203
      info->s->in_use= list_add(info->s->in_use, &info->in_use);
212
212
    /*
213
213
       Check for bad file descriptors if this table is part
214
214
       of a merge union. Failing to capture this may cause
215
 
       a crash on windows if the table is renamed and 
 
215
       a crash on windows if the table is renamed and
216
216
       later on referenced by the merge table.
217
217
     */
218
218
    if( info->owned_by_merge && (info->s)->kfile < 0 )
307
307
 
308
308
  IMPLEMENTATION
309
309
    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 
 
310
    if there is no active write lock and there is active read locks and
311
311
    myisam_concurrent_insert == 2. In this last case the new
312
312
    row('s) are inserted at end of file instead of filling up the hole.
313
313
 
357
357
    }
358
358
    if (check_keybuffer)
359
359
      _mi_test_if_changed(info);
360
 
    info->invalidator=info->s->invalidator;
361
360
  }
362
361
  else if (lock_type == F_WRLCK && info->lock_type == F_RDLCK)
363
362
  {