EMILUA(3em)
π EMILUA π
okay bestie, this is the 3em manual page for Emilua, from the Emilua reference β the Lua execution engine. buckle up, itβs giving iconic π
β¨
πΈ NAME πΈ
Emilua - Lua execution engine π
β¨ DESCRIPTION β¨
the DESCRIPTION section opens with this whole code block, so here it is exactly as it appears:
local mutex = require('mutex')
local function ping_sender()
sleep(30)
scope(function()
scope_cleanup_push(function() ws_write_mtx:unlock() end)
ws_write_mtx:lock()
ws:ping()
end)
end
local function queue_consumer()
scope(function()
scope_cleanup_push(function() queue_mtx:unlock() end)
queue_mtx:lock()
while #queue == 0 do
queue_cond:wait(queue_mtx)
end
for _, e in ipairs(queue) do
consume_item(e)
end
queue = {}
end)
end
and after all that, the description lands on: A mutex. π
π FUNCTIONS π
π new() β mutex π
constructor time, bestie. π
π lock(self) π
locks the mutex. no cap.
Note β this suspending function does not act as an cancellation point. π
Note β this mutex applies dispatch semantics: if itβs possible to acquire the mutex immediately, there will be no context switch to other ready fibers. π¦
π try_lock(self) β boolean π
tries to lock the mutex and hands back a boolean saying whether the lock acquisition was successful. β¨
Caution β itβs an error to calltry_lock()if the current fiber already owns the mutex (cf.recursive_mutex(3em)for an alternative). π
Note β the current fiber is never suspended. π
π unlock(self) π
unlocks the mutex. periodt. π«Ά
source/version: Emilua 0.12.1-nixpkgs1 Β· date: 1980-01-01 Β· manual: EMILUA(3em) β thatβs the whole page, bestie π
β¨
π¦ where this page comes from
- nixos 26.05: emilua 0.12.1
- nixpkgs unstable: emilua 0.12.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms