ROOT
v6-22
Reference Guide
RSlotStack.hxx
Go to the documentation of this file.
1
// Author: Enrico Guiraud, Danilo Piparo CERN 03/2017
2
3
/*************************************************************************
4
* Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5
* All rights reserved. *
6
* *
7
* For the licensing terms see $ROOTSYS/LICENSE. *
8
* For the list of contributors see $ROOTSYS/README/CREDITS. *
9
*************************************************************************/
10
11
#ifndef ROOT_RSLOTSTACK
12
#define ROOT_RSLOTSTACK
13
14
#include <
ROOT/TSpinMutex.hxx
>
15
16
#include <stack>
17
18
namespace
ROOT
{
19
namespace
Internal {
20
namespace
RDF {
21
22
/// This is an helper class to allow to pick a slot resorting to a map
23
/// indexed by thread ids.
24
/// WARNING: this class does not work as a regular stack. The size is
25
/// fixed at construction time and no blocking is foreseen.
26
class
RSlotStack
{
27
private
:
28
const
unsigned
int
fSize
;
29
std::stack<unsigned int>
fStack
;
30
ROOT::TSpinMutex
fMutex
;
31
32
public
:
33
RSlotStack
() =
delete
;
34
RSlotStack
(
unsigned
int
size);
35
void
ReturnSlot
(
unsigned
int
slotNumber);
36
unsigned
int
GetSlot
();
37
};
38
}
// namespace RDF
39
}
// namespace Internal
40
}
// namespace ROOT
41
42
#endif
TSpinMutex.hxx
ROOT::Internal::RDF::RSlotStack
This is an helper class to allow to pick a slot resorting to a map indexed by thread ids.
Definition:
RSlotStack.hxx:26
ROOT::Internal::RDF::RSlotStack::ReturnSlot
void ReturnSlot(unsigned int slotNumber)
Definition:
RSlotStack.cxx:23
ROOT::Internal::RDF::RSlotStack::fStack
std::stack< unsigned int > fStack
Definition:
RSlotStack.hxx:29
ROOT::Internal::RDF::RSlotStack::fMutex
ROOT::TSpinMutex fMutex
Definition:
RSlotStack.hxx:30
ROOT::Internal::RDF::RSlotStack::RSlotStack
RSlotStack()=delete
ROOT::Internal::RDF::RSlotStack::fSize
const unsigned int fSize
Definition:
RSlotStack.hxx:28
ROOT::Internal::RDF::RSlotStack::GetSlot
unsigned int GetSlot()
Definition:
RSlotStack.cxx:30
ROOT::TSpinMutex
A spin mutex class which respects the STL interface for mutexes.
Definition:
TSpinMutex.hxx:42
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition:
StringConv.hxx:21
tree
dataframe
inc
ROOT
RDF
RSlotStack.hxx
ROOT v6-22 - Reference Guide Generated on Fri Apr 1 2022 11:53:07 (GVA Time) using Doxygen 1.9.4