4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 - 2012 Christian Schoenebeck and Grigor Iliev * |
* Copyright (C) 2009 - 2013 Christian Schoenebeck and Grigor Iliev * |
8 |
* * |
* * |
9 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
10 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
85 |
InstrumentConsumer* pConsumer, |
InstrumentConsumer* pConsumer, |
86 |
RTList<R*>* pRegionsInUse |
RTList<R*>* pRegionsInUse |
87 |
) { |
) { |
88 |
RegionInfoMutex.Lock(); |
LockGuard lock(RegionInfoMutex); |
89 |
for (typename RTList<R*>::Iterator i = pRegionsInUse->first() ; i != pRegionsInUse->end() ; i++) { |
for (typename RTList<R*>::Iterator i = pRegionsInUse->first() ; i != pRegionsInUse->end() ; i++) { |
90 |
RegionInfo[*i].refCount++; |
RegionInfo[*i].refCount++; |
91 |
SampleRefCount[(*i)->pSample]++; |
SampleRefCount[(*i)->pSample]++; |
92 |
} |
} |
93 |
this->HandBack(pResource, pConsumer, true); |
this->HandBack(pResource, pConsumer, true); |
|
RegionInfoMutex.Unlock(); |
|
94 |
} |
} |
95 |
|
|
96 |
/** |
/** |
98 |
* was previously handed back. |
* was previously handed back. |
99 |
*/ |
*/ |
100 |
virtual void HandBackRegion(R* pRegion) { |
virtual void HandBackRegion(R* pRegion) { |
101 |
RegionInfoMutex.Lock(); |
LockGuard lock(RegionInfoMutex); |
102 |
if (RegionInfo.find(pRegion) == RegionInfo.end()) { |
if (RegionInfo.find(pRegion) == RegionInfo.end()) { |
103 |
std::cerr << "Handing back unknown region. This is a BUG!!!" << std::endl; |
std::cerr << "Handing back unknown region. This is a BUG!!!" << std::endl; |
104 |
} |
} |
116 |
} |
} |
117 |
RegionInfo.erase(pRegion); |
RegionInfo.erase(pRegion); |
118 |
} |
} |
|
RegionInfoMutex.Unlock(); |
|
119 |
} |
} |
120 |
|
|
121 |
virtual InstrumentManager::mode_t GetMode(const InstrumentManager::instrument_id_t& ID) { |
virtual InstrumentManager::mode_t GetMode(const InstrumentManager::instrument_id_t& ID) { |