Peano
Loading...
Searching...
No Matches
Lock.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
6namespace tarch {
7 namespace multicore {
8 class BooleanSemaphore;
9 class Lock;
10 }
11}
12
13
20 private:
24 public:
38 Lock(
40 bool aquireLockImmediately = true,
41 bool freeLockInDestructor = true
42 );
43 ~Lock();
44
45 void lock();
46
56 void free();
57 bool tryLock();
58};
59
Create a lock around a boolean semaphore region.
Definition Lock.h:19
Lock(tarch::multicore::BooleanSemaphore &semaphore, bool aquireLockImmediately=true, bool freeLockInDestructor=true)
Create lock around semaphore.
Definition Lock.cpp:6
void free()
Free the lock.
Definition Lock.cpp:37
BooleanSemaphore & _semaphore
Definition Lock.h:21
const bool _freeLockInDestructor
Definition Lock.h:23
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19