Movatterモバイル変換


[0]ホーム

URL:


Google Git
Sign in
chromium /chromium /src /refs/heads/main /. /sql /initialization.cc
blob: 8a56c2131263eb5902a242b23ce817dbeb07a735 [file] [log] [blame] [edit]
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include"sql/initialization.h"
#include"base/no_destructor.h"
#include"base/synchronization/lock.h"
#include"base/trace_event/trace_event.h"
#include"sql/vfs_wrapper.h"
#include"third_party/sqlite/sqlite3.h"
namespace sql{
voidEnsureSqliteInitialized(bool create_wrapper){
// sqlite3_initialize() uses double-checked locking and thus can have
// data races.
static base::NoDestructor<base::Lock> sqlite_init_lock;
base::AutoLock auto_lock(*sqlite_init_lock);
staticbool first_call=true;
if(first_call){
TRACE_EVENT0("sql","EnsureSqliteInitialized");
sqlite3_initialize();
first_call=false;
}
if(create_wrapper){
EnsureVfsWrapper();
}
}
}// namespace sql

[8]ページ先頭

©2009-2025 Movatter.jp