remove position pool

This commit is contained in:
Yaossg 2025-01-19 20:20:07 +08:00
parent cd6f37900d
commit ebac0d06a6

View File

@ -195,7 +195,6 @@ public:
long long int location; // current location (position) in reference chromosome.
char lastBase = 'X'; // the last base of reference line. this is for CG_only mode.
Channel<string> linePool; // pool to store unprocessed SAM line.
Channel<Position*> freePositionPool; // pool to store free position pointer for reference position.
Channel<Position*> outputPositionPool; // pool to store the reference position which is loaded and ready to output.
mutex mutex_;
long long int refCoveredPosition; // this is the last position in reference chromosome we loaded in refPositions.
@ -222,10 +221,10 @@ public:
delete workerLock[i];
}
Position* pos;
freePositionPool.close();
while(freePositionPool.recv(pos)) {
delete pos;
}
// freePositionPool.close();
// while(freePositionPool.recv(pos)) {
// delete pos;
// }
}
/**
@ -478,19 +477,14 @@ public:
* get a Position pointer from freePositionPool, if freePositionPool is empty, make a new Position pointer.
*/
void getFreePosition(Position*& newPosition) {
if (freePositionPool.recv(newPosition)) {
return;
} else {
newPosition = new Position();
}
newPosition = new Position();
}
/**
* return the position to freePositionPool.
*/
void returnPosition(Position* pos) {
pos->initialize();
freePositionPool.send(pos);
delete pos;
}
/**