Changeset: 634a74e2017c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/634a74e2017c
Modified Files:
        gdk/gdk_logger.c
Branch: group-commit
Log Message:

Fix another small data race.


diffs (15 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2748,7 +2748,10 @@ tid_in_flush_queue(logger *lg, int tid) 
 
 int 
 flush_queue_length(logger *lg) {
-       return lg->flush_queue_length;
+       MT_lock_set(&lg->flush_queue_lock);
+       int fql = lg->flush_queue_length; // Protect against add_tid_flush_queue
+       MT_lock_unset(&lg->flush_queue_lock);
+       return fql;
 }
 
 gdk_return
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to