Project
Loading...
Searching...
No Matches
qsem.h
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
14
15
#ifndef QSEM_H
16
#define QSEM_H
17
18
#ifdef _WIN32
19
#include "
pthread_mutex_win32_wrapper.h
"
20
#else
21
#include <semaphore.h>
22
#endif
23
24
class
qSem
25
{
26
public
:
27
qSem
(int32_t
num
= 1);
28
~qSem
();
29
30
int32_t
Lock
();
31
int32_t
Unlock
();
32
int32_t
Trylock
();
33
int32_t
Query
();
34
35
private
:
36
int32_t max;
37
sem_t
sem;
38
};
39
40
class
qSignal
41
{
42
private
:
43
qSem
sem;
44
45
public
:
46
qSignal
() : sem(0) {}
47
void
Wait
() { sem.
Lock
(); }
48
void
Signal
() { sem.
Unlock
(); }
49
};
50
51
#endif
num
double num
Definition
bench_Clusterizer.cxx:122
qSem
Definition
qsem.h:25
qSem::Trylock
int32_t Trylock()
Definition
qsem.cxx:57
qSem::Query
int32_t Query()
Definition
qsem.cxx:70
qSem::Unlock
int32_t Unlock()
Definition
qsem.cxx:48
qSem::~qSem
~qSem()
Definition
qsem.cxx:32
qSem::Lock
int32_t Lock()
Definition
qsem.cxx:39
qSignal
Definition
qsem.h:41
qSignal::qSignal
qSignal()
Definition
qsem.h:46
qSignal::Wait
void Wait()
Definition
qsem.h:47
qSignal::Signal
void Signal()
Definition
qsem.h:48
pthread_mutex_win32_wrapper.h
sem_t
HANDLE sem_t
Definition
pthread_mutex_win32_wrapper.h:22
GPU
GPUTracking
utils
qsem.h
Generated on Tue Feb 25 2025 17:03:27 for Project by
1.9.8