XRootD
XrdOssCsiRanges.cc
Go to the documentation of this file.
1
/******************************************************************************/
2
/* */
3
/* X r d O s s C s i R a n g e s . c c */
4
/* */
5
/* (C) Copyright 2020 CERN. */
6
/* */
7
/* This file is part of the XRootD software suite. */
8
/* */
9
/* XRootD is free software: you can redistribute it and/or modify it under */
10
/* the terms of the GNU Lesser General Public License as published by the */
11
/* Free Software Foundation, either version 3 of the License, or (at your */
12
/* option) any later version. */
13
/* */
14
/* In applying this licence, CERN does not waive the privileges and */
15
/* immunities granted to it by virtue of its status as an Intergovernmental */
16
/* Organization or submit itself to any jurisdiction. */
17
/* */
18
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21
/* License for more details. */
22
/* */
23
/* You should have received a copy of the GNU Lesser General Public License */
24
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26
/* */
27
/* The copyright holder's institutional names and contributor's names may not */
28
/* be used to endorse or promote products derived from this software without */
29
/* specific prior written permission of the institution or contributor. */
30
/******************************************************************************/
31
32
#include "
XrdOssCsiRanges.hh
"
33
#include "
XrdOssCsiPages.hh
"
34
35
#include <assert.h>
36
37
void
XrdOssCsiRangeGuard::ReleaseAll
()
38
{
39
if
(trackinglenlocked_)
40
{
41
unlockTrackinglen
();
42
}
43
44
if
(r_)
45
{
46
r_->
RemoveRange
(rp_);
47
r_ = NULL;
48
rp_ = NULL;
49
}
50
}
51
52
void
XrdOssCsiRangeGuard::Wait
()
53
{
54
assert(r_ != NULL);
55
r_->
Wait
(rp_);
56
}
57
58
void
XrdOssCsiRangeGuard::unlockTrackinglen
()
59
{
60
assert(pages_ != NULL);
61
assert(trackinglenlocked_ ==
true
);
62
63
pages_->
TrackedSizeRelease
();
64
trackinglenlocked_ =
false
;
65
pages_ = NULL;
66
}
67
68
XrdOssCsiRangeGuard::~XrdOssCsiRangeGuard
()
69
{
70
ReleaseAll
();
71
}
XrdOssCsiPages.hh
XrdOssCsiRanges.hh
XrdOssCsiPages::TrackedSizeRelease
void TrackedSizeRelease()
Definition:
XrdOssCsiPages.cc:158
XrdOssCsiRangeGuard::ReleaseAll
void ReleaseAll()
Definition:
XrdOssCsiRanges.cc:37
XrdOssCsiRangeGuard::~XrdOssCsiRangeGuard
~XrdOssCsiRangeGuard()
Definition:
XrdOssCsiRanges.cc:68
XrdOssCsiRangeGuard::Wait
void Wait()
Definition:
XrdOssCsiRanges.cc:52
XrdOssCsiRangeGuard::unlockTrackinglen
void unlockTrackinglen()
Definition:
XrdOssCsiRanges.cc:58
XrdOssCsiRanges::Wait
void Wait(XrdOssCsiRange_s *rp)
Definition:
XrdOssCsiRanges.hh:145
XrdOssCsiRanges::RemoveRange
void RemoveRange(XrdOssCsiRange_s *rp)
Definition:
XrdOssCsiRanges.hh:154
XrdOssCsi
XrdOssCsiRanges.cc
Generated by
1.9.1