Loading...
Searching...
No Matches
scoped_mutex_lock.h
Go to the documentation of this file.
#ifndef HALIDE_RUNTIME_SCOPED_MUTEX_LOCK_H
#define HALIDE_RUNTIME_SCOPED_MUTEX_LOCK_H
#include "HalideRuntime.h"
namespace Halide {
namespace Runtime {
namespace Internal {
// An RAII mutex locking operation
struct ScopedMutexLock {
halide_mutex *mutex;
ALWAYS_INLINE explicit ScopedMutexLock(halide_mutex *mutex)
: mutex(mutex) {
halide_mutex_lock(mutex);
}
ALWAYS_INLINE ~ScopedMutexLock() {
halide_mutex_unlock(mutex);
}
};
} // namespace Internal
} // namespace Runtime
} // namespace Halide
#endif
HalideRuntime.h
This file declares the routines used by Halide internally in its runtime.
halide_mutex_lock
void halide_mutex_lock(struct halide_mutex *mutex)
A basic set of mutex and condition variable functions, which call platform specific code for mutual e...
Definition synchronization_common.h:876
halide_mutex_unlock
void halide_mutex_unlock(struct halide_mutex *mutex)
Definition synchronization_common.h:882
Halide::Runtime::Internal
Definition constants.h:13
Halide::Runtime
Definition constants.h:12
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
ALWAYS_INLINE
#define ALWAYS_INLINE
Definition runtime_internal.h:57
Halide::Runtime::Internal::ScopedMutexLock::~ScopedMutexLock
ALWAYS_INLINE ~ScopedMutexLock()
Definition scoped_mutex_lock.h:19
Halide::Runtime::Internal::ScopedMutexLock::mutex
halide_mutex * mutex
Definition scoped_mutex_lock.h:12
Halide::Runtime::Internal::ScopedMutexLock::ScopedMutexLock
ALWAYS_INLINE ScopedMutexLock(halide_mutex *mutex)
Definition scoped_mutex_lock.h:14
halide_mutex
Cross-platform mutex.
Definition HalideRuntime.h:191