diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-06-19 22:28:20 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-06-20 07:50:19 +0200 |
commit | 9376f65a26240441bf9dd6ae1f69886dc9fa60fa (patch) | |
tree | 4971b86c35daa36f0fd913c61303f11320e01b4c /libreofficekit/source/gtk | |
parent | 8ae297fde961abcba627d62936efdbb5c6fe03d3 (diff) |
Consolidate on C++17 std::scoped_lock instead of std::lock_guard
...where scoped_lock was originally meant as a transparent generalization of
lock_guard, but eventually had to supersede it under a new name, for backwards-
compatibility reasons, see
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0156r2.html> "Variadic
lock_guard (Rev. 5)" and
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0488r0.pdf> "WG21
Working Paper, NB Comments, ISO/IEC CD 14882".
Change-Id: Ie58909f63beec5939601183d6bcda3bc638d5747
Reviewed-on: https://gerrit.libreoffice.org/74382
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'libreofficekit/source/gtk')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index b55ca470e253..3f43a1487502 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -2186,7 +2186,7 @@ setGraphicSelectionInThread(gpointer data) LOKDocViewPrivate& priv = getPrivate(pDocView); LOEvent* pLOEvent = static_cast<LOEvent*>(g_task_get_task_data(task)); - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); std::stringstream ss; ss << "lok::Document::setView(" << priv->m_nViewId << ")"; g_info("%s", ss.str().c_str()); @@ -2210,7 +2210,7 @@ setClientZoomInThread(gpointer data) LOKDocViewPrivate& priv = getPrivate(pDocView); LOEvent* pLOEvent = static_cast<LOEvent*>(g_task_get_task_data(task)); - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); priv->m_pDocument->pClass->setClientZoom(priv->m_pDocument, pLOEvent->m_nTilePixelWidth, pLOEvent->m_nTilePixelHeight, @@ -2226,7 +2226,7 @@ postMouseEventInThread(gpointer data) LOKDocViewPrivate& priv = getPrivate(pDocView); LOEvent* pLOEvent = static_cast<LOEvent*>(g_task_get_task_data(task)); - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); std::stringstream ss; ss << "lok::Document::setView(" << priv->m_nViewId << ")"; g_info("%s", ss.str().c_str()); @@ -2255,7 +2255,7 @@ openDocumentInThread (gpointer data) LOKDocView* pDocView = LOK_DOC_VIEW(g_task_get_source_object(task)); LOKDocViewPrivate& priv = getPrivate(pDocView); - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); if ( priv->m_pDocument ) { priv->m_pDocument->pClass->destroy( priv->m_pDocument ); @@ -2306,7 +2306,7 @@ setPartmodeInThread(gpointer data) LOEvent* pLOEvent = static_cast<LOEvent*>(g_task_get_task_data(task)); int nPartMode = pLOEvent->m_nPartMode; - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); std::stringstream ss; ss << "lok::Document::setView(" << priv->m_nViewId << ")"; g_info("%s", ss.str().c_str()); @@ -2329,7 +2329,7 @@ setEditInThread(gpointer data) else if (priv->m_bEdit && !bEdit) { g_info("lok_doc_view_set_edit: leaving edit mode"); - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); std::stringstream ss; ss << "lok::Document::setView(" << priv->m_nViewId << ")"; g_info("%s", ss.str().c_str()); @@ -2349,7 +2349,7 @@ postCommandInThread (gpointer data) LOEvent* pLOEvent = static_cast<LOEvent*>(g_task_get_task_data(task)); LOKDocViewPrivate& priv = getPrivate(pDocView); - std::lock_guard<std::mutex> aGuard(g_aLOKMutex); + std::scoped_lock<std::mutex> aGuard(g_aLOKMutex); std::stringstream ss; ss << "lok::Document::setView(" << priv->m_nViewId << ")"; g_info("%s", ss.str().c_str()); |