GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
dnsjit.core.thread(3) FreeBSD Library Functions Manual dnsjit.core.thread(3)

dnsjit.core.thread - POSIX thread with separate Lua state


local thr = require("dnsjit.core.thread").new()
thr:start(function(thr)
print("Hello from thread")
print("got:", thr:pop(), " = ", thr:pop(3))
end)
thr:push("value from main", 1, 2, 3)
thr:stop()

Start a new POSIX thread with it's own Lua state. Sharable objects can be passed to the thread by pushing and poping them of the thread stack. The Thread object and any other objects passed to the thread needs to be kept alive as long as the thread is running.

Create a new Thread object.
Return the Log object to control logging of this instance or module.
Start the thread and execute the given function in a separate Lua state, first argument to the function will be the Thread object that created it. Returns 0 on success.
Wait for the thread to return. Returns 0 on success.
Push string(s), number(s) or sharable object(s) onto the thread stack so they can be retrieved inside the thread using pop(). The sharable object(s) needs to be kept alive as long as the thread is running, strings and numbers are copied.
Pop value(s) off the thread stack, should only be called within the thread. If num is not given then one value is poped. Returns nil if no values are left on the stack.

dnsjit.core.channel(3)

Jerry Lundström (DNS-OARC), Tomáš Křížek (CZ.NIC), Petr Špaček (ISC)

Maintained by DNS-OARC

https://www.dns-oarc.net/

For issues and feature requests please use:

https://github.com/DNS-OARC/dnsjit/issues

For question and help please use:

admin@dns-oarc.net
1.4.0 dnsjit

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.