From ebac0d06a6e06706739a4ee9f6f1076ddf5e0f89 Mon Sep 17 00:00:00 2001 From: Yaossg Date: Sun, 19 Jan 2025 20:20:07 +0800 Subject: [PATCH] remove position pool --- position_3n_table.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/position_3n_table.h b/position_3n_table.h index 754b21c..2057691 100644 --- a/position_3n_table.h +++ b/position_3n_table.h @@ -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 linePool; // pool to store unprocessed SAM line. - Channel freePositionPool; // pool to store free position pointer for reference position. Channel 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; } /**