File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,10 @@ luisa::filesystem::path DefaultBinaryIO::write_internal_shader(luisa::string_vie
240
240
}
241
241
242
242
void DefaultBinaryIO::clear_shader_cache () const noexcept {
243
- if (!_use_lmdb) return ;
244
- _cache_lmdb.destroy ();
243
+ std::lock_guard lck{_global_mtx};
244
+ if (_use_lmdb) {
245
+ _cache_lmdb.destroy ();
246
+ }
245
247
std::error_code ec;
246
248
for (auto &&dir : std::filesystem::directory_iterator (_cache_dir)) {
247
249
std::filesystem::remove_all (dir, ec);
@@ -251,7 +253,9 @@ void DefaultBinaryIO::clear_shader_cache() const noexcept {
251
253
to_string (dir), ec.message ());
252
254
}
253
255
}
254
- _cache_lmdb.create (_cache_dir);
256
+ if (_use_lmdb) {
257
+ _cache_lmdb.create (_cache_dir);
258
+ }
255
259
}
256
260
257
261
}// namespace luisa::compute
You can’t perform that action at this time.
0 commit comments