Thread joining is an important primitive that I seem to have totally forgotten to implement previously.
25 lines
422 B
Modula-2
25 lines
422 B
Modula-2
object thread : object {
|
|
uid 11f23e593d5761bd
|
|
|
|
capabilities [
|
|
kill
|
|
join
|
|
]
|
|
|
|
method create [constructor] {
|
|
param process ref process [cap:create_thread]
|
|
param stack_top address
|
|
param entrypoint address
|
|
}
|
|
|
|
method kill [destructor cap:kill]
|
|
|
|
method join [cap:join]
|
|
|
|
method exit [static]
|
|
|
|
method sleep [static] {
|
|
param duration uint64
|
|
}
|
|
}
|