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

Dispatch Queue VCC Update #714

Merged
merged 4 commits into from
Mar 14, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/proof-alarm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Check
run: |
TMPFILE=$(mktemp)
echo "111d190288082ce7cebe929719747267 source/linux/epoll_event_loop.c" > $TMPFILE
echo "e857a2e5f72ab77a94e56372d89abf99 source/linux/epoll_event_loop.c" > $TMPFILE
md5sum --check $TMPFILE

# No further steps if successful
Expand Down
6 changes: 3 additions & 3 deletions tests/vcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ NO_CHANGE_FILE=source/linux/epoll_event_loop.c
$(VCC) $(VCC_ARGS) process_task_pre_queue.c /f:s_process_task_pre_queue
$(VCC) $(VCC_ARGS) lifecycle.c /f:s_stop_task /f:s_stop /f:s_wait_for_stop_completion /f:s_run
$(VCC) $(VCC_ARGS) main_loop.c /f:s_on_tasks_to_schedule /f:s_main_loop
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_default
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_destroy /p:"-DUSE_EFD=0"
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_destroy /p:"-DUSE_EFD=1"
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_default /f:s_start_destroy
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_complete_destroy /p:"-DUSE_EFD=0"
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_complete_destroy /p:"-DUSE_EFD=1"
$(VCC) $(VCC_ARGS) client.c /f:test_new_destroy /f:test_subscribe_unsubscribe

.phony: all
Expand Down
3 changes: 2 additions & 1 deletion tests/vcc/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ void test_new_destroy()
if (!event_loop) return;
_(ghost \claim c_event_loop;)
_(ghost c_event_loop = \make_claim({event_loop}, event_loop->\closed);)
s_destroy(event_loop _(ghost c_event_loop) _(ghost c_mutex));
s_start_destroy(event_loop _(ghost c_event_loop) _(ghost c_mutex));
s_complete_destroy(event_loop _(ghost c_event_loop) _(ghost c_mutex));
}

void on_event(
Expand Down
8 changes: 7 additions & 1 deletion tests/vcc/new_destroy.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,17 @@ struct aws_event_loop *aws_event_loop_new_with_epoll(
return NULL;
}

static void s_start_destroy(struct aws_event_loop *event_loop
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
) {
(void)event_loop;
}

/* Fake-up call to s_stop since this is just a vtable lookup */
#define aws_event_loop_stop(event_loop) \
s_stop(event_loop _(ghost c_event_loop) _(ghost c_mutex));

static void s_destroy(struct aws_event_loop *event_loop
static void s_complete_destroy(struct aws_event_loop *event_loop
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
) {
AWS_LOGF_INFO(AWS_LS_IO_EVENT_LOOP, "id=%p: Destroying event_loop", (void *)event_loop);
Expand Down
15 changes: 14 additions & 1 deletion tests/vcc/preamble.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,20 @@ struct aws_event_loop *aws_event_loop_new_with_epoll(
\fresh(c_mutex) && \wrapped0(c_mutex) && \claims_object(c_mutex, &(epoll_loop_of(\result)->task_pre_queue_mutex))))
;

static void s_destroy(struct aws_event_loop *event_loop
static void s_start_destroy(struct aws_event_loop *event_loop
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
)
_(requires \malloc_root(event_loop))
_(requires \malloc_root(epoll_loop_of(event_loop)))
_(requires c_event_loop != c_mutex)
_(requires \wrapped0(c_event_loop) && \claims_object(c_event_loop, event_loop))
_(requires \wrapped0(c_mutex) && \claims_object(c_mutex, &epoll_loop_of(event_loop)->task_pre_queue_mutex))
_(requires \wrapped(&epoll_loop_of(event_loop)->scheduler))
_(requires \wrapped(epoll_loop_of(event_loop)::status))
_(requires \wrapped(&epoll_loop_of(event_loop)->stop_task))
;

static void s_complete_destroy(struct aws_event_loop *event_loop
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
)
_(requires \malloc_root(event_loop))
Expand Down
Loading