diff options
| author | Carl Shapiro <cshapiro@google.com> | 2010-05-25 18:35:37 -0700 |
|---|---|---|
| committer | Carl Shapiro <cshapiro@google.com> | 2010-05-26 14:18:49 -0700 |
| commit | b31b30131bbf58280a515c40027aa958b81b5cd6 (patch) | |
| tree | ffb27c6af19d411caee647418297a8919b40780f /vm/Thread.h | |
| parent | e1bccb9fb7857a08406954702b4479c8f5292de5 (diff) | |
| download | android_dalvik-b31b30131bbf58280a515c40027aa958b81b5cd6.tar.gz android_dalvik-b31b30131bbf58280a515c40027aa958b81b5cd6.tar.bz2 android_dalvik-b31b30131bbf58280a515c40027aa958b81b5cd6.zip | |
Eliminate more unused variables and compiler warnings.
This change also introduces wrappers for condition variable operations
similar to what we have already for mutex operations.
Almost all the remaining warnings are now in the compiler or non-debug
uses of the CHECK_JIT macro.
Change-Id: I9f492f1582a06065e3a52287c7834adddfbefff9
Diffstat (limited to 'vm/Thread.h')
| -rw-r--r-- | vm/Thread.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/vm/Thread.h b/vm/Thread.h index 4956009b7..f00b0dfac 100644 --- a/vm/Thread.h +++ b/vm/Thread.h @@ -379,8 +379,7 @@ INLINE void dvmInitMutex(pthread_mutex_t* pMutex) */ INLINE void dvmLockMutex(pthread_mutex_t* pMutex) { - int cc __attribute__ ((__unused__)); - cc = pthread_mutex_lock(pMutex); + int cc __attribute__ ((__unused__)) = pthread_mutex_lock(pMutex); assert(cc == 0); } @@ -399,8 +398,7 @@ INLINE int dvmTryLockMutex(pthread_mutex_t* pMutex) */ INLINE void dvmUnlockMutex(pthread_mutex_t* pMutex) { - int cc __attribute__ ((__unused__)); - cc = pthread_mutex_unlock(pMutex); + int cc __attribute__ ((__unused__)) = pthread_mutex_unlock(pMutex); assert(cc == 0); } @@ -409,8 +407,25 @@ INLINE void dvmUnlockMutex(pthread_mutex_t* pMutex) */ INLINE void dvmDestroyMutex(pthread_mutex_t* pMutex) { - int cc __attribute__ ((__unused__)); - cc = pthread_mutex_destroy(pMutex); + int cc __attribute__ ((__unused__)) = pthread_mutex_destroy(pMutex); + assert(cc == 0); +} + +INLINE void dvmBroadcastCond(pthread_cond_t* pCond) +{ + int cc __attribute__ ((__unused__)) = pthread_cond_broadcast(pCond); + assert(cc == 0); +} + +INLINE void dvmSignalCond(pthread_cond_t* pCond) +{ + int cc __attribute__ ((__unused__)) = pthread_cond_signal(pCond); + assert(cc == 0); +} + +INLINE void dvmWaitCond(pthread_cond_t* pCond, pthread_mutex_t* pMutex) +{ + int cc __attribute__ ((__unused__)) = pthread_cond_wait(pCond, pMutex); assert(cc == 0); } |
