Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Mutex/Wren/mutex.wren
Normal file
14
Task/Mutex/Wren/mutex.wren
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
foreign class Resource {
|
||||
// obtain a pointer to the resource when available
|
||||
construct new() {}
|
||||
|
||||
// method for using the resource
|
||||
foreign doSomething()
|
||||
|
||||
// signal to the host that the resource is no longer needed
|
||||
foreign release()
|
||||
}
|
||||
|
||||
var res = Resource.new() // wait for and obtain a lock on the resource
|
||||
res.doSomething() // use it
|
||||
res.release() // release the lock
|
||||
Loading…
Add table
Add a link
Reference in a new issue