Skip to content

Commit

Permalink
Merge pull request #18756 from richardkchapman/mutex
Browse files Browse the repository at this point in the history
HPCC-31981 Mutex code was inefficient

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jun 19, 2024
2 parents 64b36aa + 501ef6d commit be024c6
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 354 deletions.
4 changes: 2 additions & 2 deletions deployment/deploy/DeployTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ class CDeployTask : public CInterface, implements IDeployTask
// Prompt to retry on error
m_errorString.appendf("Cannot copy %s to %s: ", source, target);

synchronized block(s_monitor);
MonitorBlock block(s_monitor);
if (m_pCallback->getAbortStatus())//has some other thread set the global abort flag?
break; //go back to beginning of loop where we exit on abort

Expand Down Expand Up @@ -822,7 +822,7 @@ class CDeployTask : public CInterface, implements IDeployTask

if (m_msgBoxOwner)//did this thread show the message box in last iteration of this loop?
{
synchronized block(s_monitor);
MonitorBlock block(s_monitor);
s_msgBoxActive = false;
m_msgBoxOwner = false;//up for grabs by other threads
s_monitor.notifyAll();
Expand Down
279 changes: 0 additions & 279 deletions esp/esplib/pqueue.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion system/jlib/jlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ bool CLogMsgManager::MsgProcessor::flush(unsigned timeout)
return false;
try
{
synchronized block(pullCycleMutex, timeout+start-now);
TimedMutexBlock block(pullCycleMutex, timeout+start-now);
}
catch(IException * e)
{
Expand Down
2 changes: 1 addition & 1 deletion system/jlib/jlog.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ private:
CallbackInterThreadQueueOf<LogMsg, MsgProcessor, false> q;
unsigned droppingLimit;
unsigned numToDrop = 1;
Mutex pullCycleMutex;
TimedMutex pullCycleMutex;
};
Owned<MsgProcessor> processor;

Expand Down
Loading

0 comments on commit be024c6

Please sign in to comment.