OLD | NEW |
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 |
| 11 #ifndef VPX_ONCE_H |
| 12 #define VPX_ONCE_H |
| 13 |
10 #include "vpx_config.h" | 14 #include "vpx_config.h" |
11 | 15 |
12 #if CONFIG_MULTITHREAD && defined(_WIN32) | 16 #if CONFIG_MULTITHREAD && defined(_WIN32) |
13 #include <windows.h> | 17 #include <windows.h> |
14 #include <stdlib.h> | 18 #include <stdlib.h> |
15 static void once(void (*func)(void)) | 19 static void once(void (*func)(void)) |
16 { | 20 { |
17 static CRITICAL_SECTION *lock; | 21 static CRITICAL_SECTION *lock; |
18 static LONG waiters; | 22 static LONG waiters; |
19 static int done; | 23 static int done; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 { | 92 { |
89 static int done; | 93 static int done; |
90 | 94 |
91 if(!done) | 95 if(!done) |
92 { | 96 { |
93 func(); | 97 func(); |
94 done = 1; | 98 done = 1; |
95 } | 99 } |
96 } | 100 } |
97 #endif | 101 #endif |
| 102 |
| 103 #endif |
OLD | NEW |