blob: 98de4a71cafcdd98dd403ec5873ec122194a86c4 [file] [log] [blame]
// Copyright 2021 The Pigweed Authors
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#pragma once
// PW_MULTISINK_LOCK_INTERRUPT_SAFE controls whether an interrupt-safe lock is
// used when reading and writing from the underlying ring-buffer. This is
// enabled by default, using an interrupt spin-lock instead of a mutex.
// Disabling this alters the entry precondition of the multisink, requiring that
// it not be invoked from an interrupt context.
#include "pw_sync/interrupt_spin_lock.h"
#include "pw_sync/mutex.h"
namespace pw {
namespace multisink {
using LockType = pw::sync::InterruptSpinLock;
using LockType = pw::sync::Mutex;
} // namespace multisink
} // namespace pw