... | ... | @@ -62,7 +62,7 @@ A Task is a further layer of abstraction over an OS thread. One `Task` structur |
|
|
```
|
|
|
|
|
|
|
|
|
The `myTask` function is implemented using thread-local storage.
|
|
|
For the threaded runtime, `myTask` is implemented using thread-local storage. For the single-threaded runtime, `myTask` only returns the same `Task` instance from a global variable.
|
|
|
|
|
|
|
|
|
The Task contains a mutex and a condition variable used when OS threads in the runtime need to synchronise with each other or sleep waiting for a condition to occur. The `Task` also points to the `Capability` that the `Task` currently owns (`task->cap`), or `NULL` if the `Task` does not currently own a `Capability`.
|
... | ... | |