~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_locking.cc

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  int error;
35
35
  uint32_t count;
36
36
  MYISAM_SHARE *share=info->s;
 
37
#if defined(FULL_LOG) || defined(_lint)
37
38
  uint32_t flag;
 
39
#endif
38
40
 
39
41
  if (!info->s->in_use)
40
42
    info->s->in_use= new list<Session *>;
47
49
    info->s->in_use->push_front(info->in_use);
48
50
    return(0);
49
51
  }
 
52
#if defined(FULL_LOG) || defined(_lint)
 
53
  flag=0;
 
54
#endif
50
55
 
51
 
  flag=error=0;
 
56
  error=0;
52
57
  if (share->kfile >= 0)                /* May only be false on windows */
53
58
  {
54
59
    switch (lock_type) {
98
103
            mi_mark_crashed(info);
99
104
          }
100
105
        }
 
106
#if defined(FULL_LOG) || defined(_lint)
101
107
        if (info->lock_type != F_EXTRA_LCK)
102
108
        {
103
109
          if (share->r_locks)
109
115
            flag=1;
110
116
          }
111
117
        }
 
118
#endif
112
119
      }
113
120
      info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
114
121
      info->lock_type= F_UNLCK;
123
130
          mysqld does not turn write locks to read locks,
124
131
          so we're never here in mysqld.
125
132
        */
 
133
#if defined(FULL_LOG) || defined(_lint)
126
134
        if (share->w_locks == 1)
127
135
        {
128
136
          flag=1;
129
137
        }
 
138
#endif
130
139
        share->w_locks--;
131
140
        share->r_locks++;
132
141
        info->lock_type=lock_type;
134
143
      }
135
144
      if (!share->r_locks && !share->w_locks)
136
145
      {
 
146
#if defined(FULL_LOG) || defined(_lint)
137
147
        flag=1;
 
148
#endif
138
149
        if (mi_state_info_read_dsk(share->kfile, &share->state, 1))
139
150
        {
140
151
          error=errno;
158
169
      {                                         /* Change READONLY to RW */
159
170
        if (share->r_locks == 1)
160
171
        {
 
172
#if defined(FULL_LOG) || defined(_lint)
161
173
          flag=1;
 
174
#endif
162
175
          share->r_locks--;
163
176
          share->w_locks++;
164
177
          info->lock_type=lock_type;
169
182
      {
170
183
        if (!share->w_locks)
171
184
        {
 
185
#if defined(FULL_LOG) || defined(_lint)
172
186
          flag=1;
 
187
#endif
173
188
          if (!share->r_locks)
174
189
          {
175
190
            if (mi_state_info_read_dsk(share->kfile, &share->state, 1))