[Pkg-privacy-commits] [nautilus-wipe] 163/224: Set error quarks atomically

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 19:45:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository nautilus-wipe.

commit 4f0c2ac863083b1039a4a34300bb15697b1b31d0
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Mon May 21 16:36:07 2012 +0200

    Set error quarks atomically
---
 nautilus-wipe/delete-operation.c | 10 ++++++----
 nautilus-wipe/fill-operation.c   | 10 ++++++----
 nautilus-wipe/nautilus-wipe.c    | 10 ++++++----
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/nautilus-wipe/delete-operation.c b/nautilus-wipe/delete-operation.c
index 4b69dea..c2c74d6 100644
--- a/nautilus-wipe/delete-operation.c
+++ b/nautilus-wipe/delete-operation.c
@@ -35,13 +35,15 @@
 GQuark
 nautilus_wipe_delete_operation_error_quark (void)
 {
-  static GQuark q = 0;
+  static volatile gsize quark = 0;
   
-  if (G_UNLIKELY (q == 0)) {
-    q = g_quark_from_static_string ("NautilusWipeDeleteOperationError");
+  if (g_once_init_enter (&quark)) {
+    GQuark q = g_quark_from_static_string ("NautilusWipeDeleteOperationError");
+    
+    g_once_init_leave (&quark, q);
   }
   
-  return q;
+  return (GQuark) quark;
 }
 
 /*
diff --git a/nautilus-wipe/fill-operation.c b/nautilus-wipe/fill-operation.c
index 8be6bc8..68d8c7b 100644
--- a/nautilus-wipe/fill-operation.c
+++ b/nautilus-wipe/fill-operation.c
@@ -39,13 +39,15 @@
 GQuark
 nautilus_wipe_fill_operation_error_quark (void)
 {
-  static GQuark q = 0;
+  static volatile gsize quark = 0;
   
-  if (G_UNLIKELY (q == 0)) {
-    q = g_quark_from_static_string ("NautilusWipeFillOperationError");
+  if (g_once_init_enter (&quark)) {
+    GQuark q = g_quark_from_static_string ("NautilusWipeFillOperationError");
+    
+    g_once_init_leave (&quark, q);
   }
   
-  return q;
+  return (GQuark) quark;
 }
 
 #if HAVE_GIO_UNIX
diff --git a/nautilus-wipe/nautilus-wipe.c b/nautilus-wipe/nautilus-wipe.c
index 0b9e2d1..66d60a0 100644
--- a/nautilus-wipe/nautilus-wipe.c
+++ b/nautilus-wipe/nautilus-wipe.c
@@ -62,13 +62,15 @@ static void   nautilus_wipe_menu_provider_iface_init  (NautilusMenuProviderIface
 GQuark
 nautilus_wipe_error_quark (void)
 {
-  static GQuark error_quark = 0;
+  static volatile gsize quark = 0;
   
-  if (G_UNLIKELY (error_quark == 0)) {
-    error_quark = g_quark_from_static_string ("NautilusWipeError");
+  if (g_once_init_enter (&quark)) {
+    GQuark q = g_quark_from_static_string ("NautilusWipeError");
+    
+    g_once_init_leave (&quark, q);
   }
   
-  return error_quark;
+  return (GQuark) quark;
 }
 
 NAUTILUS_WIPE_DEFINE_TYPE_MODULE_WITH_CODE (NautilusWipe,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git



More information about the Pkg-privacy-commits mailing list