[libgee] Sleep 100 ms in GC thread when there is nothing to do



commit 14ada432f82a5f1d4b65918e2a2de67a28e7e9db
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Sat Oct 11 23:23:28 2014 -0700

    Sleep 100 ms in GC thread when there is nothing to do
    
    Temporal fix for bug 737507 until something more sane would come up
    while still being lock free.

 gee/hazardpointer.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gee/hazardpointer.vala b/gee/hazardpointer.vala
index 22aca16..f95fd74 100644
--- a/gee/hazardpointer.vala
+++ b/gee/hazardpointer.vala
@@ -458,6 +458,9 @@ public class Gee.HazardPointer<G> { // FIXME: Make it a struct
                                                Thread.yield ();
                                                pull_from_queue (ctx._to_free, ctx._to_free.is_empty);
                                                ctx.try_free ();
+                                               if (ctx._to_free.is_empty) {
+                                                       GLib.Thread.usleep (100000);
+                                               }
                                        }
                                });
                                break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]