Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/2228 fix threadsafe disabled wavemodcounter #2228

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Packages/MIES/MIES_Async.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ Function ASYNC_Execute(dfr)
DFREF dfr

variable orderIndex, size, index
string dest

ASSERT(ASYNC_IsThreadDF(dfr), "Invalid data folder or not a thread data folder")
NVAR tgID = $GetThreadGroupID()
Expand Down Expand Up @@ -617,6 +618,15 @@ Function ASYNC_Execute(dfr)
endif

#ifdef THREADING_DISABLED
if(IsFreeDataFolder(dfr))
KillTrashFolders()
DFREF tmpdfr = GetUniqueTempPath()
dest = RemoveEnding(GetDataFolder(1, tmpDFR), ":")
MoveDataFolder/Z dfr, $dest
if(V_flag)
printf "ASYNC_Execute: Could not move free DF to global DF: %s to %s\r", GetDataFolder(1, dfr), dest
endif
endif
DFREF result = ASYNC_Run_Worker(dfr)
WAVE/DF serialExecutionBuffer = GetSerialExecutionBuffer(getAsyncHomeDF())
index = GetNumberFromWaveNote(serialExecutionBuffer, NOTE_INDEX)
Expand Down
8 changes: 1 addition & 7 deletions Packages/MIES/MIES_IgorHooks.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ static Function IH_KillTemporaries()
KillStrings/Z dfrHW:ITCDeviceList

// try to delete all trash folders
trashFolders = GetListOfObjects(dfr, TRASH_FOLDER_PREFIX + ".*", typeFlag = COUNTOBJECTS_DATAFOLDER, fullPath = 1)

numFolders = ItemsInList(trashFolders)
for(i = 0; i < numFolders; i += 1)
path = StringFromList(i, trashFolders)
KillDataFolder/Z $path
endfor
KillTrashFolders()

RemoveEmptyDataFolder(dfr)

Expand Down
12 changes: 12 additions & 0 deletions Packages/MIES/MIES_MiesUtilities_DataManagement.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,15 @@ threadsafe Function MoveToTrash([wv, dfr])
endif
endif
End

threadsafe Function KillTrashFolders()

string dfPath

DFREF dfr = GetMiesPath()
WAVE/T trashFolders = ListToTextWave(GetListOfObjects(dfr, TRASH_FOLDER_PREFIX + ".*", typeFlag = COUNTOBJECTS_DATAFOLDER, fullPath = 1), ";")

for(dfPath : trashFolders)
KillDataFolder/Z $dfPath
endfor
End