From 54e8d7fd952d6404231427f930a539124172d9b9 Mon Sep 17 00:00:00 2001 From: raster Date: Sun, 22 Aug 2010 05:47:44 +0000 Subject: [PATCH] oops - formatting at start too - not just end git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@51510 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_log.c | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/lib/eina_log.c b/src/lib/eina_log.c index dd59068..4723940 100644 --- a/src/lib/eina_log.c +++ b/src/lib/eina_log.c @@ -350,39 +350,39 @@ static pthread_t _main_thread; # define SELF() pthread_self() # define IS_MAIN(t) pthread_equal(t, _main_thread) # define IS_OTHER(t) EINA_UNLIKELY(!IS_MAIN(t)) -# define CHECK_MAIN(...) \ - do { \ - if (!IS_MAIN(pthread_self())) { \ - fprintf(stderr, \ - "ERR: not main thread! current=%lu, main=%lu\n", \ - (unsigned long)pthread_self(), \ - (unsigned long)_main_thread); \ - return __VA_ARGS__; \ - } \ - } while (0) +# define CHECK_MAIN(...) \ + do { \ + if (!IS_MAIN(pthread_self())) { \ + fprintf(stderr, \ + "ERR: not main thread! current=%lu, main=%lu\n", \ + (unsigned long)pthread_self(), \ + (unsigned long)_main_thread); \ + return __VA_ARGS__; \ + } \ + } while (0) # ifdef EFL_HAVE_POSIX_THREADS_SPINLOCK static pthread_spinlock_t _log_lock; -# define LOG_LOCK() \ - if(_threads_enabled) \ - do { \ - if (0) { \ - fprintf(stderr, "+++LOG LOG_LOCKED! [%s, %lu]\n", \ - __FUNCTION__, (unsigned long)pthread_self()); } \ - if (EINA_UNLIKELY(_threads_enabled)) { \ - pthread_spin_lock(&_log_lock); } \ - } while (0) -# define LOG_UNLOCK() \ - if(_threads_enabled) \ - do { \ - if (EINA_UNLIKELY(_threads_enabled)) { \ - pthread_spin_unlock(&_log_lock); } \ - if (0) { \ - fprintf(stderr, \ - "---LOG LOG_UNLOCKED! [%s, %lu]\n", \ - __FUNCTION__, (unsigned long)pthread_self()); } \ - } while (0) +# define LOG_LOCK() \ + if (_threads_enabled) \ + do { \ + if (0) { \ + fprintf(stderr, "+++LOG LOG_LOCKED! [%s, %lu]\n", \ + __FUNCTION__, (unsigned long)pthread_self()); } \ + if (EINA_UNLIKELY(_threads_enabled)) { \ + pthread_spin_lock(&_log_lock); } \ + } while (0) +# define LOG_UNLOCK() \ + if (_threads_enabled) \ + do { \ + if (EINA_UNLIKELY(_threads_enabled)) { \ + pthread_spin_unlock(&_log_lock); } \ + if (0) { \ + fprintf(stderr, \ + "---LOG LOG_UNLOCKED! [%s, %lu]\n", \ + __FUNCTION__, (unsigned long)pthread_self()); } \ + } while (0) # define INIT() pthread_spin_init(&_log_lock, PTHREAD_PROCESS_PRIVATE) # define SHUTDOWN() pthread_spin_destroy(&_log_lock) @@ -405,15 +405,15 @@ static DWORD _main_thread; # define SELF() GetCurrentThreadId() # define IS_MAIN(t) (t == _main_thread) # define IS_OTHER(t) EINA_UNLIKELY(!IS_MAIN(t)) -# define CHECK_MAIN(...) \ - do { \ - if (!IS_MAIN(GetCurrentThreadId())) { \ - fprintf(stderr, \ - "ERR: not main thread! current=%lu, main=%lu\n", \ - GetCurrentThreadId(), _main_thread); \ - return __VA_ARGS__; \ - } \ - } while (0) +# define CHECK_MAIN(...) \ + do { \ + if (!IS_MAIN(GetCurrentThreadId())) { \ + fprintf(stderr, \ + "ERR: not main thread! current=%lu, main=%lu\n", \ + GetCurrentThreadId(), _main_thread); \ + return __VA_ARGS__; \ + } \ + } while (0) static HANDLE _log_mutex = NULL; -- 2.7.4