Chromium Code Reviews| Index: native_client_sdk/src/examples/api/input_event/shared_queue.h |
| diff --git a/native_client_sdk/src/examples/api/input_event/shared_queue.h b/native_client_sdk/src/examples/api/input_event/shared_queue.h |
| index b3c17845c61e3b5f52f0649de4efa6cbacb3c210..6eb841ba0c65c408347efcd99f8fcbdb32d8e67f 100644 |
| --- a/native_client_sdk/src/examples/api/input_event/shared_queue.h |
| +++ b/native_client_sdk/src/examples/api/input_event/shared_queue.h |
| @@ -9,6 +9,12 @@ |
| #include <cassert> |
| #include <deque> |
| +#ifdef __GNUC__ |
|
binji
2013/09/04 20:21:48
not sure I like adding UNUSED to this header. Does
Sam Clegg
2013/09/04 20:54:43
I prefer the attribute to the #pragma.
(void) doe
|
| +#define UNUSED __attribute__ ((unused)) |
| +#else |
| +#define UNUSED |
| +#endif |
| + |
| // This file provides a queue that uses a mutex and condition variable so that |
| // one thread can put pointers into the queue and another thread can pull items |
| // out of the queue. |
| @@ -52,6 +58,7 @@ class ScopedLock { |
| ScopedLock(const ScopedLock&); |
| }; |
| + |
| // LockingQueue contains a collection of <T>, such as a collection of |
| // objects or pointers. The Push() method is used to add items to the |
| // queue in a thread-safe manner. The GetItem() is used to retrieve |
| @@ -59,7 +66,8 @@ class ScopedLock { |
| template <class T> class LockingQueue { |
| public: |
| LockingQueue() : quit_(false) { |
| - int result = pthread_mutex_init(&queue_mutex_, NULL); |
| + int result UNUSED; |
| + result = pthread_mutex_init(&queue_mutex_, NULL); |
| assert(result == 0); |
| result = pthread_cond_init(&queue_condition_var_, NULL); |
| assert(result == 0); |