/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
/* Implement a function wrapper to guarantee initialization * thread-safety for library singletons. * * NOTE: This function uses static locks, and can only be * used with one common argument per compilation unit. So * * file1.c: * aom_once(foo); * ... * aom_once(foo); * * file2.c: * aom_once(bar); * * will ensure foo() and bar() are each called only once, but in * * file1.c: * aom_once(foo); * aom_once(bar): * * bar() will never be called because the lock is used up * by the call to foo().
*/
#if CONFIG_MULTITHREAD && defined(_WIN32) #undef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #include <windows.h> /* Declare a per-compilation-unit state variable to track the progress * of calling func() only once. This must be at global scope because * local initializers are not thread-safe in MSVC prior to Visual * Studio 2015.
*/ static INIT_ONCE aom_init_once = INIT_ONCE_STATIC_INIT;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.