1 /** 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef RUNTIME_MEM_LOCK_CONFIG_HELPER_H 16 #define RUNTIME_MEM_LOCK_CONFIG_HELPER_H 17 18 #include "file_items.h" 19 20 namespace panda { 21 enum LangTypeT : bool { LANG_TYPE_STATIC, LANG_TYPE_DYNAMIC }; 22 enum MTModeT { MT_MODE_SINGLE, MT_MODE_MULTI, MT_MODE_TASK }; 23 24 namespace mem { 25 26 template <class LockConfig, MTModeT MTMode> 27 class LockConfigHelper { 28 }; 29 30 template <class LockConfigT> 31 class LockConfigHelper<LockConfigT, MT_MODE_MULTI> { 32 public: 33 using Value = typename LockConfigT::CommonLock; 34 }; 35 36 template <class LockConfigT> 37 class LockConfigHelper<LockConfigT, MT_MODE_SINGLE> { 38 public: 39 using Value = typename LockConfigT::DummyLock; 40 }; 41 } // namespace mem 42 } // namespace panda 43 44 #endif // RUNTIME_MEM_LOCK_CONFIG_HELPER_H 45