is it possible the function in the thread to avoid hanging the server when performing long functions (while True then ... end)?
[DOUBLEPOST=1433571386][/DOUBLEPOST]я пробовал
but still freezesCode:co = coroutine.create(function () while true do rank() coroutine.yield() end end)coroutine.resume(co);
[DOUBLEPOST=1433768736,1433571107][/DOUBLEPOST]judging by the silence - there are no threads in lua?
Solved Thread (lua)
Discussion in 'Rust Development' started by Мизантроп, Jun 8, 2015.
-
Your best bet would be to use a timer.
-
[DOUBLEPOST=1433835221,1433825529][/DOUBLEPOST]Tried to make a thread in C# (I'm noob):
Code:using System.Threading;...public void SystemTimerTick() {Thread t = new Thread(new ThreadStart(ThreadProc)); t.Start(); } if (timerr == 1) { Puts("{0}: {1}", Title, timerr.ToString()); } }
Code:[Oxide] 10:34 AM [Error] Failed to run a 1.00 timer in Sinhronize (UnauthorizedAccessException: System access is restricted, you are not allowed to use System.Threading.Thread) [Oxide] 10:34 AM [Debug] at Oxide.Plugins.Sinhronize.<Init>m__0 () [0x00000] in <filename unknown>:0 at Oxide.Core.Libraries.Timer+TimerInstance.Update () [0x00000] in <filename unknown>:0
-
Здарова. Пишешь на c#?
[en]Hello. You write on c#? -
[ru] То есть можно выполнить вот так вот:
[en] That is, you can do so here:
Code:QueueWorkerThread( { Puts("Hi! I new Thread ))"); });
[en] And it will work? -
[en] No -
It does not work is not one of the options ....
Give please example
[DOUBLEPOST=1433868977][/DOUBLEPOST]forum sleeping =(
solution:
Code:QueueWorkerThread(delegate { Puts("test"); });