Changeset: b69ee96537e3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b69ee96537e3
Modified Files:
        sql/common/sql_list.c
Branch: default
Log Message:

only lock if needed


diffs (16 lines):

diff --git a/sql/common/sql_list.c b/sql/common/sql_list.c
--- a/sql/common/sql_list.c
+++ b/sql/common/sql_list.c
@@ -825,7 +825,9 @@ list_hash_add(list *l, void *data, fcmp 
 void
 list_hash_clear(list *l)
 {
-       MT_lock_set(&l->ht_lock);
-       l->ht = NULL;
-       MT_lock_unset(&l->ht_lock);
+       if (l->ht) {
+               MT_lock_set(&l->ht_lock);
+               l->ht = NULL;
+               MT_lock_unset(&l->ht_lock);
+       }
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to