diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/linda.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/linda.cpp b/src/linda.cpp index e4ae3f4..81926f9 100644 --- a/src/linda.cpp +++ b/src/linda.cpp | |||
| @@ -180,6 +180,11 @@ int Linda::ProtectedCall(lua_State* L_, lua_CFunction f_) | |||
| 180 | if (_K == nullptr) | 180 | if (_K == nullptr) |
| 181 | return 0; | 181 | return 0; |
| 182 | 182 | ||
| 183 | // no GC allowed during the call, because we don't want to trigger collection of another linda | ||
| 184 | // bound to the same keeper, as that would cause a deadlock when trying to acquire it while | ||
| 185 | // doing LindaFactory::deleteDeepObjectInternal -> keeper_call(clear) | ||
| 186 | lua_gc(L_, LUA_GCSTOP, 0); | ||
| 187 | |||
| 183 | LUA_ASSERT_CODE(auto const _koip{ _linda->startKeeperOperation(L_) }); | 188 | LUA_ASSERT_CODE(auto const _koip{ _linda->startKeeperOperation(L_) }); |
| 184 | // if we didn't do anything wrong, the keeper stack should be clean | 189 | // if we didn't do anything wrong, the keeper stack should be clean |
| 185 | LUA_ASSERT(L_, lua_gettop(_K) == 0); | 190 | LUA_ASSERT(L_, lua_gettop(_K) == 0); |
| @@ -192,6 +197,9 @@ int Linda::ProtectedCall(lua_State* L_, lua_CFunction f_) | |||
| 192 | // whatever happens, the keeper state stack must be empty when we are done | 197 | // whatever happens, the keeper state stack must be empty when we are done |
| 193 | lua_settop(_K, 0); | 198 | lua_settop(_K, 0); |
| 194 | 199 | ||
| 200 | // restore normal GC operations | ||
| 201 | lua_gc(L_, LUA_GCRESTART, 0); | ||
| 202 | |||
| 195 | // release the keeper | 203 | // release the keeper |
| 196 | _linda->releaseKeeper(_keeper); | 204 | _linda->releaseKeeper(_keeper); |
| 197 | 205 | ||
