Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:57

0001 /*
0002     Copyright (c) 2005-2020 Intel Corporation
0003 
0004     Licensed under the Apache License, Version 2.0 (the "License");
0005     you may not use this file except in compliance with the License.
0006     You may obtain a copy of the License at
0007 
0008         http://www.apache.org/licenses/LICENSE-2.0
0009 
0010     Unless required by applicable law or agreed to in writing, software
0011     distributed under the License is distributed on an "AS IS" BASIS,
0012     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013     See the License for the specific language governing permissions and
0014     limitations under the License.
0015 */
0016 
0017 #ifndef __TBB_null_mutex_H
0018 #define __TBB_null_mutex_H
0019 
0020 #include "tbb_stddef.h"
0021 
0022 namespace tbb {
0023 
0024 //! A mutex which does nothing
0025 /** A null_mutex does no operation and simulates success.
0026     @ingroup synchronization */
0027 class null_mutex : internal::mutex_copy_deprecated_and_disabled {
0028 public:
0029     //! Represents acquisition of a mutex.
0030     class scoped_lock : internal::no_copy {
0031     public:
0032         scoped_lock() {}
0033         scoped_lock( null_mutex& ) {}
0034         ~scoped_lock() {}
0035         void acquire( null_mutex& ) {}
0036         bool try_acquire( null_mutex& ) { return true; }
0037         void release() {}
0038     };
0039 
0040     null_mutex() {}
0041 
0042     // Mutex traits
0043     static const bool is_rw_mutex = false;
0044     static const bool is_recursive_mutex = true;
0045     static const bool is_fair_mutex = true;
0046 };
0047 
0048 }
0049 
0050 #endif /* __TBB_null_mutex_H */