Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: src/platform-linux.cc

Issue 7400023: fix -Wunused-but-set-variable for gcc-4.6 on x64 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index ab22a79cd4294a24c310308e8a9ef4fec2413a91..ea8e5f014201b9a8b89fbfdb76574ab2226e3c73 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -728,12 +728,15 @@ class LinuxMutex : public Mutex {
public:
LinuxMutex() {
pthread_mutexattr_t attrs;
- int result = pthread_mutexattr_init(&attrs);
- ASSERT(result == 0);
- result = pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE);
- ASSERT(result == 0);
- result = pthread_mutex_init(&mutex_, &attrs);
- ASSERT(result == 0);
+#ifdef DEBUG
+#define CHECK_RESULT(exp) ASSERT((exp) == 0)
+#else
+#define CHECK_RESULT(exp) exp
+#endif
+ CHECK_RESULT(pthread_mutexattr_init(&attrs));
+ CHECK_RESULT(pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE));
+ CHECK_RESULT(pthread_mutex_init(&mutex_, &attrs));
+#undef CHECK_RESULT
}
virtual ~LinuxMutex() { pthread_mutex_destroy(&mutex_); }
« no previous file with comments | « src/parser.cc ('k') | src/third_party/valgrind/valgrind.h » ('j') | src/x64/code-stubs-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698