Mutex: Difference between revisions

Content added Content deleted
imported>Katsumi
No edit summary
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
Line 1,395: Line 1,395:
However, to avoid excessive latency, a VM whose thread were continuing would need to signal to the host that it no longer needed the resource so the lock could be released thereby making it available to the other VM(s). Typically, a shared resource might need to be represented something like this in a Wren script:
However, to avoid excessive latency, a VM whose thread were continuing would need to signal to the host that it no longer needed the resource so the lock could be released thereby making it available to the other VM(s). Typically, a shared resource might need to be represented something like this in a Wren script:


<syntaxhighlight lang="ecmascript">foreign class Resource {
<syntaxhighlight lang="wren">foreign class Resource {
// obtain a pointer to the resource when available
// obtain a pointer to the resource when available
construct new() {}
construct new() {}