Skip to content

Commit b8c8223

Browse files
committed
Move GIL position
1 parent 789146f commit b8c8223

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/export_cache.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ static void pypluginCache_free(cache_t* cache) {
167167
if (!cache) {
168168
return;
169169
}
170+
py::gil_scoped_acquire acquire;
170171
if (!cache->eviction_params) {
171172
// No params, just free the cache structure
172173
cache_struct_free(cache);
@@ -183,8 +184,8 @@ static void pypluginCache_free(cache_t* cache) {
183184
}
184185

185186
static bool pypluginCache_get(cache_t* cache, const request_t* req) {
186-
py::gil_scoped_acquire acquire;
187187
bool hit = cache_get_base(cache, req);
188+
py::gil_scoped_acquire acquire;
188189
pypluginCache_params_t* params =
189190
(pypluginCache_params_t*)cache->eviction_params;
190191

0 commit comments

Comments
 (0)