For the latest stable version, please use Emilua API 0.10! |
system.signal.set
local set = system.signal.set.new(system.signal.SIGTERM, system.signal.SIGINT)
set:wait()
This class provides the ability to wait for one or more signals to occur.
Multiple registration of signals
|
Functions
new([sig1: integer, …]) → system.signal.set
Constructor.
Arguments are treated as signals to be added to the set.
Only the main VM on the process may create new set objects. If the VM
elects another VM to be the new main VM, its old set objects will remain valid
and working, but the VM won’t be able to create new set objects.
|
add(self, signal: integer)
Add a signal to the set.
Only the master VM is allowed to use this function. |
wait(self) → integer
Wait for a signal to be delivered. The function will return when:
-
One of the registered signals in the set occurs; or
-
The set was cancelled, in which case the function will raise the exception
boost::asio::error::operation_aborted
.
A number is returned to indicate which signal occurred.
Queueing of signal notifications
|