Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to AsioEvent to see if an event is a oneshot #3198

Merged
merged 3 commits into from
Jun 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to the Pony compiler and standard library will be documented
- Allow use of OpenSSL 1.1.1 when building Pony ([PR #3156](https://github.com/ponylang/ponyc/pull/3156))
- Add `pointer.offset` to get arbitrary pointer tags via offset ([PR #3177](https://github.com/ponylang/ponyc/pull/3177))
- Add DTrace/SystemTap probes for muted & unmuted events ([PR #3196](https://github.com/ponylang/ponyc/pull/3196))
- Add method to AsioEvent to see if an event is a oneshot ([PR #3198](https://github.com/ponylang/ponyc/pull/3198))

### Changed

Expand Down
6 changes: 6 additions & 0 deletions packages/builtin/asio_event.pony
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ primitive AsioEvent
"""
flags == 0

fun oneshotable(flags: U32): Bool =>
"""
Returns true if the flags contain the oneshot flag.
"""
(flags and (1 << 8)) != 0

fun dispose(): U32 => 0

fun read(): U32 => 1 << 0
Expand Down