~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_locking.c

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-21 20:26:28 UTC
  • mto: (960.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 961.
  • Revision ID: osullivan.padraig@gmail.com-20090321202628-nh6qsi825m4d4av6
Removing the queues.[h,cc] files from the mysys directory. The only place
where they are needed now is in the MyISAM storage engine. Thus, I moved the
files there and updated the files in the MyISAM storage engine
appropriately.

Show diffs side-by-side

added added

removed removed

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