| 24 | } |
| 25 | |
| 26 | FileHandle* Spiller::getOrCreateDataFH() const { |
| 27 | if (dataFH.load()) { |
| 28 | return dataFH; |
| 29 | } |
| 30 | std::unique_lock lock(fileCreationMutex); |
| 31 | // Another thread may have created the file while the lock was being acquired |
| 32 | if (dataFH.load()) { |
| 33 | return dataFH; |
| 34 | } |
| 35 | const_cast<Spiller*>(this)->dataFH = bufferManager.getFileHandle(tmpFilePath, |
| 36 | FileHandle::O_PERSISTENT_FILE_CREATE_NOT_EXISTS, vfs, nullptr); |
| 37 | return dataFH; |
| 38 | } |
| 39 | |
| 40 | FileHandle* Spiller::getDataFH() const { |
| 41 | if (dataFH.load()) { |
nothing calls this directly
no test coverage detected