114185Sgabeblack@google.com# Copyright 2019 Google Inc. 214185Sgabeblack@google.com# 314185Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without 414185Sgabeblack@google.com# modification, are permitted provided that the following conditions are 514185Sgabeblack@google.com# met: redistributions of source code must retain the above copyright 614185Sgabeblack@google.com# notice, this list of conditions and the following disclaimer; 714185Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright 814185Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the 914185Sgabeblack@google.com# documentation and/or other materials provided with the distribution; 1014185Sgabeblack@google.com# neither the name of the copyright holders nor the names of its 1114185Sgabeblack@google.com# contributors may be used to endorse or promote products derived from 1214185Sgabeblack@google.com# this software without specific prior written permission. 1314185Sgabeblack@google.com# 1414185Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1514185Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1614185Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1714185Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1814185Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1914185Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2014185Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2114185Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2214185Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2314185Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2414185Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2514185Sgabeblack@google.com# 2614185Sgabeblack@google.com# Authors: Gabe Black 2714185Sgabeblack@google.com 2814185Sgabeblack@google.comImport('*') 2914185Sgabeblack@google.com 3014185Sgabeblack@google.comSource('atomic.cc') 3114185Sgabeblack@google.comSource('functional.cc') 3214185Sgabeblack@google.comSource('timing.cc') 33