~gthorslund/drizzle/add-constraints-to-kernel-sysvars

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-12-03 01:16:19 UTC
  • mfrom: (1819.9.81 update-innobase)
  • Revision ID: kalebral@gmail.com-20101203011619-n6v584rijwdet05b
Merge Stewart - update Innobase plugin based on InnoDB 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
Currently we support native aio on windows and linux */
143
143
UNIV_INTERN my_bool     srv_use_native_aio = TRUE;
144
144
 
 
145
#ifdef __WIN__
 
146
/* Windows native condition variables. We use runtime loading / function
 
147
pointers, because they are not available on Windows Server 2003 and
 
148
Windows XP/2000.
 
149
 
 
150
We use condition for events on Windows if possible, even if os_event
 
151
resembles Windows kernel event object well API-wise. The reason is
 
152
performance, kernel objects are heavyweights and WaitForSingleObject() is a
 
153
performance killer causing calling thread to context switch. Besides, Innodb
 
154
is preallocating large number (often millions) of os_events. With kernel event
 
155
objects it takes a big chunk out of non-paged pool, which is better suited
 
156
for tasks like IO than for storing idle event objects. */
 
157
UNIV_INTERN ibool       srv_use_native_conditions = FALSE;
 
158
#endif /* __WIN__ */
 
159
 
145
160
UNIV_INTERN ulint       srv_n_data_files = 0;
146
161
UNIV_INTERN char**      srv_data_file_names = NULL;
147
162
/* size in database pages */
1659
1674
                    start_time != -1 && finish_time != -1) {
1660
1675
                        srv_n_lock_max_wait_time = diff_time;
1661
1676
                }
 
1677
 
 
1678
                /* Record the lock wait time for this thread */
 
1679
                thd_set_lock_wait_time(trx->mysql_thd, diff_time);
1662
1680
        }
1663
1681
 
1664
1682
        if (trx->was_chosen_as_deadlock_victim) {
3037
3055
 
3038
3056
        slot_no = srv_table_reserve_slot(SRV_WORKER);
3039
3057
 
 
3058
        slot = srv_table_get_nth_slot(slot_no);
 
3059
 
3040
3060
        ++srv_n_threads_active[SRV_WORKER];
3041
3061
 
3042
3062
        mutex_exit(&kernel_mutex);
3088
3108
 
3089
3109
        mutex_enter(&kernel_mutex);
3090
3110
 
 
3111
        ut_ad(srv_table_get_nth_slot(slot_no) == slot);
 
3112
 
3091
3113
        /* Decrement the active count. */
3092
3114
        srv_suspend_thread();
3093
3115
 
3094
 
        mutex_exit(&kernel_mutex);
 
3116
        slot->in_use = FALSE;
3095
3117
 
3096
3118
        /* Free the thread local memory. */
3097
3119
        thr_local_free(os_thread_get_curr_id());
3098
3120
 
3099
 
        mutex_enter(&kernel_mutex);
3100
 
 
3101
 
        /* Free the slot for reuse. */
3102
 
        slot = srv_table_get_nth_slot(slot_no);
3103
 
        slot->in_use = FALSE;
3104
 
 
3105
3121
        mutex_exit(&kernel_mutex);
3106
3122
 
3107
3123
#ifdef UNIV_DEBUG_THREAD_CREATION