pike.git/
src/
threads.c
Branch:
Tag:
Non-build tags
All tags
No tags
2015-06-01
2015-06-01 15:33:31 by Henrik Grubbström (Grubba) <grubba@grubba.org>
fb7d8616732f4e04b5564fcb51b6fb6ffcb6c640 (
5
lines) (+
5
/-
0
)
[
Show
|
Annotate
]
Branch:
8.1
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) {