~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_dynrec.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
size_t mi_mmap_pread(MI_INFO *info, unsigned char *Buffer,
143
143
                    size_t Count, internal::my_off_t offset, myf MyFlags)
144
144
{
145
 
  if (info->s->concurrent_insert)
146
 
    pthread_rwlock_rdlock(&info->s->mmap_lock);
147
 
 
148
145
  /*
149
146
    The following test may fail in the following cases:
150
147
    - We failed to remap a memory area (fragmented memory?)
155
152
  if (info->s->mmaped_length >= offset + Count)
156
153
  {
157
154
    memcpy(Buffer, info->s->file_map + offset, Count);
158
 
    if (info->s->concurrent_insert)
159
 
      pthread_rwlock_unlock(&info->s->mmap_lock);
160
155
    return 0;
161
156
  }
162
157
  else
163
158
  {
164
 
    if (info->s->concurrent_insert)
165
 
      pthread_rwlock_unlock(&info->s->mmap_lock);
166
159
    return my_pread(info->dfile, Buffer, Count, offset, MyFlags);
167
160
  }
168
161
}
196
189
size_t mi_mmap_pwrite(MI_INFO *info, const unsigned char *Buffer,
197
190
                      size_t Count, internal::my_off_t offset, myf MyFlags)
198
191
{
199
 
  if (info->s->concurrent_insert)
200
 
    pthread_rwlock_rdlock(&info->s->mmap_lock);
201
192
 
202
193
  /*
203
194
    The following test may fail in the following cases:
209
200
  if (info->s->mmaped_length >= offset + Count)
210
201
  {
211
202
    memcpy(info->s->file_map + offset, Buffer, Count);
212
 
    if (info->s->concurrent_insert)
213
 
      pthread_rwlock_unlock(&info->s->mmap_lock);
214
203
    return 0;
215
204
  }
216
205
  else
217
206
  {
218
207
    info->s->nonmmaped_inserts++;
219
 
    if (info->s->concurrent_insert)
220
 
      pthread_rwlock_unlock(&info->s->mmap_lock);
221
208
    return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags);
222
209
  }
223
210