Peano
Loading...
Searching...
No Matches
MultiReadSingleWriteSemaphore.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
7
8
9namespace tarch {
10 namespace multicore {
11 class MultiReadSingleWriteSemaphore;
12 class MultiReadSingleWriteLock;
13 }
14}
15
16
17#if defined(SharedTBB) or defined(SharedTBBExtension)
19#else
20
51 private:
53
54 const bool _highPriorityToWrites;
55 BooleanSemaphore _semaphore;
56 volatile bool _writeAccessAcquired;
57 volatile int _numberOfPendingWriteRequests;
58 volatile int _numberOfActiveReadAccesses;
59
95
101
105 MultiReadSingleWriteSemaphore( const MultiReadSingleWriteSemaphore& ) = delete;
106
110 MultiReadSingleWriteSemaphore& operator = ( const MultiReadSingleWriteSemaphore& ) { return *this; }
111
112 public:
113 MultiReadSingleWriteSemaphore(bool highPriorityToWrites = true);
115
117};
118
119#endif
Create a lock around a boolean semaphore region.
tarch::multicore::MultiReadSingleWriteLock Lock
void leaveCriticalReadSection()
Tells the semaphore that it is about to leave.
MultiReadSingleWriteSemaphore & operator=(const MultiReadSingleWriteSemaphore &)
You may not copy a semaphore.
MultiReadSingleWriteSemaphore(const MultiReadSingleWriteSemaphore &)=delete
You may not copy a semaphore.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19