Use -O not -O3: reduces ccan/tdb test time from 24 to 18 seconds.
[ccan] / ccan / tdb / traverse.c
index 953edcf4479688ac3ccd859d23ffedd7d735ed23..1ca88d71b6326a6cf1a7f67170d030800c26a0c6 100644 (file)
@@ -229,7 +229,7 @@ int tdb_traverse_read(struct tdb_context *tdb,
        ret = _tdb_traverse(tdb, fn, private_data, &tl);
        tdb->traverse_read--;
 
-       tdb_transaction_unlock(tdb);
+       tdb_transaction_unlock(tdb, F_RDLCK);
 
        return ret;
 }
@@ -260,7 +260,7 @@ int tdb_traverse(struct tdb_context *tdb,
        ret = _tdb_traverse(tdb, fn, private_data, &tl);
        tdb->traverse_write--;
 
-       tdb_transaction_unlock(tdb);
+       tdb_transaction_unlock(tdb, F_WRLCK);
 
        return ret;
 }