Kaydet (Commit) 28bd5531 authored tarafından Julien Nabet's avatar Julien Nabet

Use std::queue instead of list for ChangeRequestQueueProcessor (sd)

Change-Id: I2520efb92e4aef399b684262e0b7daa72d212598
Reviewed-on: https://gerrit.libreoffice.org/72073
Tested-by: Jenkins
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 7dda9378
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <list> #include <queue>
namespace com { namespace sun { namespace star { namespace drawing { namespace framework { class XConfigurationChangeRequest; } } } } } namespace com { namespace sun { namespace star { namespace drawing { namespace framework { class XConfigurationChangeRequest; } } } } }
...@@ -33,7 +33,7 @@ namespace sd { namespace framework { ...@@ -33,7 +33,7 @@ namespace sd { namespace framework {
ChangeRequestQueueProcessor to process these requests. ChangeRequestQueueProcessor to process these requests.
*/ */
class ChangeRequestQueue class ChangeRequestQueue
: public ::std::list<css::uno::Reference< css::drawing::framework::XConfigurationChangeRequest> > : public ::std::queue<css::uno::Reference< css::drawing::framework::XConfigurationChangeRequest> >
{ {
public: public:
/** Create an empty queue. /** Create an empty queue.
......
...@@ -91,7 +91,7 @@ void ChangeRequestQueueProcessor::AddRequest ( ...@@ -91,7 +91,7 @@ void ChangeRequestQueueProcessor::AddRequest (
TraceRequest(rxRequest); TraceRequest(rxRequest);
#endif #endif
maQueue.push_back(rxRequest); maQueue.push(rxRequest);
StartProcessing(); StartProcessing();
} }
...@@ -135,7 +135,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent() ...@@ -135,7 +135,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent()
// Get and remove the first entry from the queue. // Get and remove the first entry from the queue.
Reference<XConfigurationChangeRequest> xRequest (maQueue.front()); Reference<XConfigurationChangeRequest> xRequest (maQueue.front());
maQueue.pop_front(); maQueue.pop();
// Execute the change request. // Execute the change request.
if (xRequest.is()) if (xRequest.is())
...@@ -176,7 +176,8 @@ void ChangeRequestQueueProcessor::ProcessUntilEmpty() ...@@ -176,7 +176,8 @@ void ChangeRequestQueueProcessor::ProcessUntilEmpty()
void ChangeRequestQueueProcessor::Clear() void ChangeRequestQueueProcessor::Clear()
{ {
::osl::MutexGuard aGuard (maMutex); ::osl::MutexGuard aGuard (maMutex);
maQueue.clear(); ChangeRequestQueue aEmpty;
maQueue.swap(aEmpty);
} }
} } // end of namespace sd::framework::configuration } } // end of namespace sd::framework::configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment