mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Warn when RAII lock returned from function is discarded
Discarding RAII lock returned from function almost always is a bug. This change introduces usage of [[no_discard]] attribute from C++17 to prevent such misues. Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d672920121
commit
90ba50bf52
@@ -67,7 +67,7 @@ struct BuiltinFunctionsLib {
|
||||
virtual Kernel *getImageFunction(ImageBuiltin func) = 0;
|
||||
virtual void initBuiltinKernel(Builtin builtId) = 0;
|
||||
virtual void initBuiltinImageKernel(ImageBuiltin func) = 0;
|
||||
MOCKABLE_VIRTUAL std::unique_lock<MutexType> obtainUniqueOwnership();
|
||||
[[nodiscard]] MOCKABLE_VIRTUAL std::unique_lock<MutexType> obtainUniqueOwnership();
|
||||
|
||||
protected:
|
||||
BuiltinFunctionsLib() = default;
|
||||
|
||||
Reference in New Issue
Block a user