Use a special cross_thread_mutex_t to avoid thread switches in perfmon collection.
Minor change. Also, this currently dead-locks. Looks like we really need a cross-thread rw lock.
Made cross_thread_mutex recursive to avoid deadlock issue in perfmon collection.
Merge branch 'next' into daniel_1183_spinlock
Refactored cross_thread_mutex
Merge branch 'daniel_1183_spinlock' into next