summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'liblog/fake_log_device.c')
-rw-r--r--liblog/fake_log_device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c
index 8a8ece250..cb80ee63c 100644
--- a/liblog/fake_log_device.c
+++ b/liblog/fake_log_device.c
@@ -99,6 +99,10 @@ static pthread_mutex_t fakeLogDeviceLock = PTHREAD_MUTEX_INITIALIZER;
99 99
100static void lock() 100static void lock()
101{ 101{
102 /*
103 * If we trigger a signal handler in the middle of locked activity and the
104 * signal handler logs a message, we could get into a deadlock state.
105 */
102 pthread_mutex_lock(&fakeLogDeviceLock); 106 pthread_mutex_lock(&fakeLogDeviceLock);
103} 107}
104 108
@@ -106,9 +110,12 @@ static void unlock()
106{ 110{
107 pthread_mutex_unlock(&fakeLogDeviceLock); 111 pthread_mutex_unlock(&fakeLogDeviceLock);
108} 112}
113
109#else // !defined(_WIN32) 114#else // !defined(_WIN32)
115
110#define lock() ((void)0) 116#define lock() ((void)0)
111#define unlock() ((void)0) 117#define unlock() ((void)0)
118
112#endif // !defined(_WIN32) 119#endif // !defined(_WIN32)
113 120
114 121