Branch: Tag:

2015-06-01

2015-06-01 15:36:07 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Threads: Keep track of the time spent with threads disabled.

380:      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0; + PMOD_EXPORT cpu_time_t threads_disabled_acc_time = 0; + PMOD_EXPORT cpu_time_t threads_disabled_start = 0;      #ifdef PIKE_DEBUG   static THREAD_T threads_disabled_thread = 0;
901:    "low_init_threads_disable(): Disabling threads.\n"));       threads_disabled = 1; +  threads_disabled_start = get_real_time();   #ifdef PIKE_DEBUG    threads_disabled_thread = th_self();   #endif
958:    if(threads_disabled) {    if(!--threads_disabled) {    IMUTEX_T *im = (IMUTEX_T *)interleave_list; +  threads_disabled_acc_time += get_real_time() - threads_disabled_start;       /* Order shouldn't matter for unlock, so no need to do it backwards. */    while(im) {