OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 #include "queue.h" | 6 #include "queue.h" |
7 | 7 |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 message = g_queue[g_queue_start]; | 108 message = g_queue[g_queue_start]; |
109 g_queue_start = (g_queue_start + 1) % MAX_QUEUE_SIZE; | 109 g_queue_start = (g_queue_start + 1) % MAX_QUEUE_SIZE; |
110 g_queue_size--; | 110 g_queue_size--; |
111 | 111 |
112 pthread_mutex_unlock(&g_queue_mutex); | 112 pthread_mutex_unlock(&g_queue_mutex); |
113 | 113 |
114 return message; | 114 return message; |
115 } | 115 } |
OLD | NEW |