зеркало из https://github.com/github/ruby.git
Tweak return of `Ractor#close`, add doc
This commit is contained in:
Родитель
7c548278f0
Коммит
bd6cd85155
|
@ -150,21 +150,26 @@ class Ractor
|
|||
attr_reader :ractor
|
||||
end
|
||||
|
||||
# Closes the incoming port and returns its previous state.
|
||||
def close_incoming
|
||||
__builtin_cexpr! %q{
|
||||
ractor_close_incoming(ec, RACTOR_PTR(self));
|
||||
}
|
||||
end
|
||||
|
||||
# Closes the outgoing port and returns its previous state.
|
||||
def close_outgoing
|
||||
__builtin_cexpr! %q{
|
||||
ractor_close_outgoing(ec, RACTOR_PTR(self));
|
||||
}
|
||||
end
|
||||
|
||||
# Closes both incoming and outgoing ports.
|
||||
def close
|
||||
close_incoming
|
||||
close_outgoing
|
||||
|
||||
self
|
||||
end
|
||||
|
||||
# utility method
|
||||
|
|
Загрузка…
Ссылка в новой задаче