Skip to content

Commit

Permalink
Refs #4554 debugging output for locking
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Feb 6, 2012
1 parent b984502 commit dc5a5b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ namespace Mantid
== m_writeLockedWorkspaces.end())
{
// Write-lock it if not already
g_log.debug() << "Write-locking " << ws->getName() << std::endl;
ws->getLock()->writeLock();
m_writeLockedWorkspaces.push_back(ws);
}
Expand All @@ -318,6 +319,7 @@ namespace Mantid
== m_writeLockedWorkspaces.end())
{
// Read-lock it if not already write-locked
g_log.debug() << "Read-locking " << ws->getName() << std::endl;
ws->getLock()->readLock();
m_readLockedWorkspaces.push_back(ws);
}
Expand All @@ -339,13 +341,19 @@ namespace Mantid
{
Workspace_sptr ws = m_writeLockedWorkspaces[i];
if (ws)
{
g_log.debug() << "Unlocking " << ws->getName() << std::endl;
ws->getLock()->unlock();
}
}
for (size_t i=0; i<m_readLockedWorkspaces.size(); i++)
{
Workspace_sptr ws = m_readLockedWorkspaces[i];
if (ws)
{
g_log.debug() << "Unlocking " << ws->getName() << std::endl;
ws->getLock()->unlock();
}
}

// Don't double-unlock workspaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def name(self):

def PyInit(self):
# Input workspace
self.declareWorkspaceProperty("InputWorkspace", "", Direction=Direction.Input, Description="Workspace to be normalised")
self.declareWorkspaceProperty("InputWorkspace", "", Direction=Direction.InOut, Description="Workspace to be normalised")
self.declareProperty("NormaliseToBeam", True, Description="If true, the data will also be normalise by the beam profile")
self.declareProperty("OutputMessage", "", Direction=Direction.Output)

Expand Down

0 comments on commit dc5a5b2

Please sign in to comment.