diff options
Diffstat (limited to '')
-rw-r--r-- | src/keeper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp index 682d70d..51f6388 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
@@ -660,7 +660,7 @@ void init_keepers(Universe* U, lua_State* L) | |||
660 | lua_pop(L, 1); // settings | 660 | lua_pop(L, 1); // settings |
661 | if (nb_keepers < 1) | 661 | if (nb_keepers < 1) |
662 | { | 662 | { |
663 | luaL_error(L, "Bad number of keepers (%d)", nb_keepers); // doesn't return | 663 | raise_luaL_error(L, "Bad number of keepers (%d)", nb_keepers); |
664 | } | 664 | } |
665 | STACK_CHECK(L, 0); | 665 | STACK_CHECK(L, 0); |
666 | 666 | ||
@@ -675,7 +675,7 @@ void init_keepers(Universe* U, lua_State* L) | |||
675 | U->keepers = static_cast<Keepers*>(U->internal_allocator.alloc(bytes)); | 675 | U->keepers = static_cast<Keepers*>(U->internal_allocator.alloc(bytes)); |
676 | if (U->keepers == nullptr) | 676 | if (U->keepers == nullptr) |
677 | { | 677 | { |
678 | luaL_error(L, "init_keepers() failed while creating keeper array; out of memory"); // doesn't return | 678 | raise_luaL_error(L, "init_keepers() failed while creating keeper array; out of memory"); |
679 | } | 679 | } |
680 | U->keepers->Keepers::Keepers(); | 680 | U->keepers->Keepers::Keepers(); |
681 | U->keepers->gc_threshold = keepers_gc_threshold; | 681 | U->keepers->gc_threshold = keepers_gc_threshold; |
@@ -692,7 +692,7 @@ void init_keepers(Universe* U, lua_State* L) | |||
692 | KeeperState const K{ create_state(U, L) }; | 692 | KeeperState const K{ create_state(U, L) }; |
693 | if (K == nullptr) | 693 | if (K == nullptr) |
694 | { | 694 | { |
695 | luaL_error(L, "init_keepers() failed while creating keeper states; out of memory"); // doesn't return | 695 | raise_luaL_error(L, "init_keepers() failed while creating keeper states; out of memory"); |
696 | } | 696 | } |
697 | 697 | ||
698 | U->keepers->keeper_array[i].L = K; | 698 | U->keepers->keeper_array[i].L = K; |
@@ -829,7 +829,7 @@ KeeperCallResult keeper_call(Universe* U, KeeperState K, keeper_api_t func_, lua | |||
829 | { // func_ linda args... | 829 | { // func_ linda args... |
830 | lua_call(K, 1 + args, LUA_MULTRET); // result... | 830 | lua_call(K, 1 + args, LUA_MULTRET); // result... |
831 | int const retvals{ lua_gettop(K) - top_K }; | 831 | int const retvals{ lua_gettop(K) - top_K }; |
832 | // note that this can raise a luaL_error while the keeper state (and its mutex) is acquired | 832 | // note that this can raise a lua error while the keeper state (and its mutex) is acquired |
833 | // this may interrupt a lane, causing the destruction of the underlying OS thread | 833 | // this may interrupt a lane, causing the destruction of the underlying OS thread |
834 | // after this, another lane making use of this keeper can get an error code from the mutex-locking function | 834 | // after this, another lane making use of this keeper can get an error code from the mutex-locking function |
835 | // when attempting to grab the mutex again (WINVER <= 0x400 does this, but locks just fine, I don't know about pthread) | 835 | // when attempting to grab the mutex again (WINVER <= 0x400 does this, but locks just fine, I don't know about pthread) |
@@ -862,7 +862,7 @@ KeeperCallResult keeper_call(Universe* U, KeeperState K, keeper_api_t func_, lua | |||
862 | int const gc_usage_after{ lua_gc(K, LUA_GCCOUNT, 0) }; | 862 | int const gc_usage_after{ lua_gc(K, LUA_GCCOUNT, 0) }; |
863 | if (gc_usage_after > gc_threshold) [[unlikely]] | 863 | if (gc_usage_after > gc_threshold) [[unlikely]] |
864 | { | 864 | { |
865 | luaL_error(L, "Keeper GC threshold is too low, need at least %d", gc_usage_after); | 865 | raise_luaL_error(L, "Keeper GC threshold is too low, need at least %d", gc_usage_after); |
866 | } | 866 | } |
867 | } | 867 | } |
868 | } | 868 | } |