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
6
namespace
tarch
{
7
namespace
multicore {
8
class
BooleanSemaphore;
9
class
Lock;
10
}
11
}
12
13
19
class
tarch::multicore::Lock
{
20
private
:
21
BooleanSemaphore
&
_semaphore
;
22
bool
_lockIsAquired
;
23
const
bool
_freeLockInDestructor
;
24
public
:
38
Lock
(
39
tarch::multicore::BooleanSemaphore
& semaphore,
40
bool
aquireLockImmediately =
true
,
41
bool
freeLockInDestructor =
true
42
);
43
~Lock
();
44
45
void
lock
();
46
56
void
free
();
57
bool
tryLock
();
58
};
59
tarch::multicore::BooleanSemaphore
Definition
BooleanSemaphore.h:21
tarch::multicore::Lock
Create a lock around a boolean semaphore region.
Definition
Lock.h:19
tarch::multicore::Lock::Lock
Lock(tarch::multicore::BooleanSemaphore &semaphore, bool aquireLockImmediately=true, bool freeLockInDestructor=true)
Create lock around semaphore.
Definition
Lock.cpp:6
tarch::multicore::Lock::free
void free()
Free the lock.
Definition
Lock.cpp:37
tarch::multicore::Lock::_lockIsAquired
bool _lockIsAquired
Definition
Lock.h:22
tarch::multicore::Lock::tryLock
bool tryLock()
Definition
Lock.cpp:23
tarch::multicore::Lock::_semaphore
BooleanSemaphore & _semaphore
Definition
Lock.h:21
tarch::multicore::Lock::_freeLockInDestructor
const bool _freeLockInDestructor
Definition
Lock.h:23
tarch::multicore::Lock::lock
void lock()
Definition
Lock.cpp:30
tarch::multicore::Lock::~Lock
~Lock()
Definition
Lock.cpp:16
tarch
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition
accelerator.h:19
src
tarch
multicore
Lock.h
Generated on Fri Apr 11 2025 10:18:08 for Peano by
1.10.0