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

Side by Side Diff: source/libvpx/vpx_ports/vpx_once.h

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « source/libvpx/vpx_ports/mem.h ('k') | source/libvpx/vpx_scale/generic/gen_scalers.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 #elif CONFIG_MULTITHREAD && HAVE_PTHREAD_H 103 #elif CONFIG_MULTITHREAD && HAVE_PTHREAD_H
104 #include <pthread.h> 104 #include <pthread.h>
105 static void once(void (*func)(void)) 105 static void once(void (*func)(void))
106 { 106 {
107 static pthread_once_t lock = PTHREAD_ONCE_INIT; 107 static pthread_once_t lock = PTHREAD_ONCE_INIT;
108 pthread_once(&lock, func); 108 pthread_once(&lock, func);
109 } 109 }
110 110
111 111
112 #else 112 #else
113 /* No-op version that performs no synchronization. vp8_rtcd() is idempotent, 113 /* No-op version that performs no synchronization. *_rtcd() is idempotent,
114 * so as long as your platform provides atomic loads/stores of pointers 114 * so as long as your platform provides atomic loads/stores of pointers
115 * no synchronization is strictly necessary. 115 * no synchronization is strictly necessary.
116 */ 116 */
117 117
118 static void once(void (*func)(void)) 118 static void once(void (*func)(void))
119 { 119 {
120 static int done; 120 static int done;
121 121
122 if(!done) 122 if(!done)
123 { 123 {
124 func(); 124 func();
125 done = 1; 125 done = 1;
126 } 126 }
127 } 127 }
128 #endif 128 #endif
129 129
130 #endif // VPX_PORTS_VPX_ONCE_H_ 130 #endif // VPX_PORTS_VPX_ONCE_H_
OLDNEW
« no previous file with comments | « source/libvpx/vpx_ports/mem.h ('k') | source/libvpx/vpx_scale/generic/gen_scalers.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698