1cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol/*
2cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * Copyright (C) 2016 The Android Open Source Project
3cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol *
4cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * Licensed under the Apache License, Version 2.0 (the "License");
5cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * you may not use this file except in compliance with the License.
6cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * You may obtain a copy of the License at
7cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol *
8cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol *      http://www.apache.org/licenses/LICENSE-2.0
9cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol *
10cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * Unless required by applicable law or agreed to in writing, software
11cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * distributed under the License is distributed on an "AS IS" BASIS,
12cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * See the License for the specific language governing permissions and
14cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * limitations under the License.
15cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol */
16cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol
17cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol#ifndef CHRE_PLATFORM_SLPI_MUTEX_BASE_H_
18cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol#define CHRE_PLATFORM_SLPI_MUTEX_BASE_H_
19cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol
20cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignolextern "C" {
21cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol
22cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol#include "qurt_mutex.h"
23cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol
24cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol}  // extern "C"
25cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol
2612b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignolnamespace chre {
2712b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol
28cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol/**
29cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol * The SLPI implementation of MutexBase.
30cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol */
3112b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignolclass MutexBase {
3212b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol protected:
33cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol  //! The underlying QURT mutex.
3412b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol  qurt_mutex_t mMutex;
3512b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol
3612b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol  //! Make the condition variable a friend so that wait() can be implemented.
3712b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol  friend class ConditionVariable;
38cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol};
39cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol
4012b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol}  // namespace chre
4112b12ca0dde6dc87f391b962d06bca238f8e6708Andrew Rossignol
42cb7282229b6897fe6afdcc97816479e6e47957b2Andrew Rossignol#endif  // CHRE_PLATFORM_SLPI_MUTEX_BASE_H_
43