From e737a106c8c1f17ecb0f6f2daae6084ff3d18183 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 5 Oct 2012 13:15:17 -0500 Subject: [PATCH] Put the 'stapdyn_big_dumb_lock' back. * runtime/dyninst/runtime.h: Put the 'stapdyn_big_dumb_lock' back until the print buffers are properly multithreaded. --- runtime/dyninst/runtime.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime/dyninst/runtime.h b/runtime/dyninst/runtime.h index 7108ed135..3165f15bf 100644 --- a/runtime/dyninst/runtime.h +++ b/runtime/dyninst/runtime.h @@ -71,8 +71,18 @@ static inline int pseudo_atomic_cmpxchg(atomic_t *v, int oldval, int newval) } -#define preempt_disable() 0 -#define preempt_enable_no_resched() 0 +static pthread_mutex_t stapdyn_big_dumb_lock = PTHREAD_MUTEX_INITIALIZER; + +static inline void preempt_disable(void) +{ + pthread_mutex_lock(&stapdyn_big_dumb_lock); +} + +static inline void preempt_enable_no_resched(void) +{ + pthread_mutex_unlock(&stapdyn_big_dumb_lock); +} + #include "linux_defs.h" -- 2.43.5