aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r--src/lanes.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp
index 000668a..8033de7 100644
--- a/src/lanes.cpp
+++ b/src/lanes.cpp
@@ -505,17 +505,13 @@ LUAG_FUNC(lane_new)
505 505
506// ################################################################################################ 506// ################################################################################################
507 507
508#if HAVE_LANE_TRACKING()
509//---
510// threads() -> {}|nil 508// threads() -> {}|nil
511//
512// Return a list of all known lanes 509// Return a list of all known lanes
513LUAG_FUNC(threads) 510LUAG_FUNC(threads)
514{ 511{
515 LaneTracker const& _tracker = universe_get(L_)->tracker; 512 LaneTracker const& _tracker = universe_get(L_)->tracker;
516 return _tracker.pushThreadsTable(L_); 513 return _tracker.pushThreadsTable(L_);
517} 514}
518#endif // HAVE_LANE_TRACKING()
519 515
520// ################################################################################################# 516// #################################################################################################
521// ######################################## Timer support ########################################## 517// ######################################## Timer support ##########################################
@@ -652,13 +648,14 @@ LUAG_FUNC(configure)
652 std::ignore = luaG_getfield(L_, 1, "demote_full_userdata"); // L_: settings demote_full_userdata 648 std::ignore = luaG_getfield(L_, 1, "demote_full_userdata"); // L_: settings demote_full_userdata
653 _U->demoteFullUserdata = lua_toboolean(L_, -1) ? true : false; 649 _U->demoteFullUserdata = lua_toboolean(L_, -1) ? true : false;
654 lua_pop(L_, 1); // L_: settings 650 lua_pop(L_, 1); // L_: settings
655#if HAVE_LANE_TRACKING() 651
652 // tracking
656 std::ignore = luaG_getfield(L_, 1, "track_lanes"); // L_: settings track_lanes 653 std::ignore = luaG_getfield(L_, 1, "track_lanes"); // L_: settings track_lanes
657 if (lua_toboolean(L_, -1)) { 654 if (lua_toboolean(L_, -1)) {
658 _U->tracker.activate(); 655 _U->tracker.activate();
659 } 656 }
660 lua_pop(L_, 1); // L_: settings 657 lua_pop(L_, 1); // L_: settings
661#endif // HAVE_LANE_TRACKING() 658
662 // Linked chains handling 659 // Linked chains handling
663 _U->selfdestructFirst = SELFDESTRUCT_END; 660 _U->selfdestructFirst = SELFDESTRUCT_END;
664 _U->initializeAllocatorFunction(L_); 661 _U->initializeAllocatorFunction(L_);
@@ -690,13 +687,13 @@ LUAG_FUNC(configure)
690 lua_setfield(L_, -2, "configure"); // L_: settings M 687 lua_setfield(L_, -2, "configure"); // L_: settings M
691 // add functions to the module's table 688 // add functions to the module's table
692 luaG_registerlibfuncs(L_, global::sLanesFunctions); 689 luaG_registerlibfuncs(L_, global::sLanesFunctions);
693#if HAVE_LANE_TRACKING() 690
694 // register core.threads() only if settings say it should be available 691 // register core.threads() only if settings say it should be available
695 if (_U->tracker.isActive()) { 692 if (_U->tracker.isActive()) {
696 lua_pushcfunction(L_, LG_threads); // L_: settings M LG_threads() 693 lua_pushcfunction(L_, LG_threads); // L_: settings M LG_threads()
697 lua_setfield(L_, -2, "threads"); // L_: settings M 694 lua_setfield(L_, -2, "threads"); // L_: settings M
698 } 695 }
699#endif // HAVE_LANE_TRACKING() 696
700 STACK_CHECK(L_, 2); 697 STACK_CHECK(L_, 2);
701 698
702 { 699 {