1 /* 2 * Copyright (C) 2025-2025 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 MOCK_FFRT_API_CPP_SHARED_MUTEX_H 16 #define MOCK_FFRT_API_CPP_SHARED_MUTEX_H 17 18 #include "c/shared_mutex.h" 19 20 namespace ffrt { 21 22 class shared_mutex : public ffrt_rwlock_t { 23 public: shared_mutex()24 shared_mutex() 25 {} 26 ~shared_mutex()27 ~shared_mutex() 28 {} 29 30 shared_mutex(const shared_mutex &) = delete; 31 32 void operator=(const shared_mutex &) = delete; 33 lock()34 inline void lock() 35 {} 36 try_lock()37 inline bool try_lock() 38 { 39 return true; 40 } 41 unlock()42 inline void unlock() 43 {} 44 lock_shared()45 inline void lock_shared() 46 {} 47 try_lock_shared()48 inline bool try_lock_shared() 49 { 50 return true; 51 } 52 unlock_shared()53 inline void unlock_shared() 54 {} 55 }; 56 } // namespace ffrt 57 58 #endif