~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innobase/srv/srv0srv.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
/* variable counts amount of data read in total (in bytes) */
219
219
ulint srv_data_read = 0;
220
220
 
 
221
/* Internal setting for "innodb_stats_method". Decides how InnoDB treats
 
222
NULL value when collecting statistics. By default, it is set to
 
223
SRV_STATS_NULLS_EQUAL(0), ie. all NULL value are treated equal */
 
224
ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL;
 
225
 
221
226
/* here we count the amount of data written in total (in bytes) */
222
227
ulint srv_data_written = 0;
223
228
 
2175
2180
                        os_thread_create */
2176
2181
{
2177
2182
        /* number of successive fatal timeouts observed */
2178
 
        ulint   fatal_cnt       = 0;
2179
 
        dulint  old_lsn;
2180
 
        dulint  new_lsn;
 
2183
        ulint           fatal_cnt       = 0;
 
2184
        dulint          old_lsn;
 
2185
        dulint          new_lsn;
 
2186
        /* longest waiting thread for a semaphore */
 
2187
        os_thread_id_t  waiter          = os_thread_get_curr_id();
 
2188
        os_thread_id_t  old_waiter      = waiter;
 
2189
        /* the semaphore that is being waited for */
 
2190
        const void*     sema            = NULL;
 
2191
        const void*     old_sema        = NULL;
2181
2192
 
2182
2193
        old_lsn = srv_start_lsn;
2183
2194
 
2219
2230
        /* In case mutex_exit is not a memory barrier, it is
2220
2231
        theoretically possible some threads are left waiting though
2221
2232
        the semaphore is already released. Wake up those threads: */
2222
 
        
 
2233
 
2223
2234
        sync_arr_wake_threads_if_sema_free();
2224
2235
 
2225
 
        if (sync_array_print_long_waits()) {
 
2236
        if (sync_array_print_long_waits(&waiter, &sema)
 
2237
            && sema == old_sema && os_thread_eq(waiter, old_waiter)) {
2226
2238
                fatal_cnt++;
2227
2239
                if (fatal_cnt > 10) {
2228
2240
 
2237
2249
                }
2238
2250
        } else {
2239
2251
                fatal_cnt = 0;
 
2252
                old_waiter = waiter;
 
2253
                old_sema = sema;
2240
2254
        }
2241
2255
 
2242
2256
        /* Flush stderr so that a database user gets the output