Logo ROOT  
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
18namespace ROOT {
19namespace Internal {
20namespace 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.
27private:
28 const unsigned int fSize;
29 std::stack<unsigned int> fStack;
31
32public:
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
This is an helper class to allow to pick a slot resorting to a map indexed by thread ids.
Definition: RSlotStack.hxx:26
void ReturnSlot(unsigned int slotNumber)
Definition: RSlotStack.cxx:23
std::stack< unsigned int > fStack
Definition: RSlotStack.hxx:29
A spin mutex class which respects the STL interface for mutexes.
Definition: TSpinMutex.hxx:42
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21