summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rocklib.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rocklib.c')
-rw-r--r--apps/plugins/lua/rocklib.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index b37f5245dc..d1ef3adaaf 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -77,6 +77,15 @@ RB_WRAP(schedule_cpu_boost)
77} 77}
78#endif 78#endif
79 79
80RB_WRAP(thread_set_priority)
81{
82 unsigned int thread_id = rb->thread_self();
83 int priority = (int) luaL_checkint(L, 1);
84 int result = rb->thread_set_priority(thread_id, priority);
85 lua_pushinteger(L, result);
86 return 1;
87}
88
80RB_WRAP(current_path) 89RB_WRAP(current_path)
81{ 90{
82 return get_current_path(L, 1); 91 return get_current_path(L, 1);
@@ -769,6 +778,7 @@ static const luaL_Reg rocklib[] =
769#ifdef HAVE_SCHEDULER_BOOSTCTRL 778#ifdef HAVE_SCHEDULER_BOOSTCTRL
770 RB_FUNC(schedule_cpu_boost), 779 RB_FUNC(schedule_cpu_boost),
771#endif 780#endif
781 RB_FUNC(thread_set_priority),
772 782
773 RB_FUNC(current_path), 783 RB_FUNC(current_path),
774 784
@@ -846,7 +856,7 @@ LUALIB_API int luaopen_rock(lua_State *L)
846 lua_pushstring(L, "rb_defines"); 856 lua_pushstring(L, "rb_defines");
847 if (lua_pcall (L, 1, 0, 0)) 857 if (lua_pcall (L, 1, 0, 0))
848 lua_pop(L, 1); 858 lua_pop(L, 1);
849#if 0 859#if 0 /* see rb_defines.lua */
850 static const struct lua_int_reg rlib_const_int[] = 860 static const struct lua_int_reg rlib_const_int[] =
851 { 861 {
852 /* useful integer constants */ 862 /* useful integer constants */