Skip to content

Commit 0160506

Browse files
authored
Dispatch Queue VCC Update (#714)
1 parent ca0228a commit 0160506

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

.github/workflows/proof-alarm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Check
1717
run: |
1818
TMPFILE=$(mktemp)
19-
echo "111d190288082ce7cebe929719747267 source/linux/epoll_event_loop.c" > $TMPFILE
19+
echo "e857a2e5f72ab77a94e56372d89abf99 source/linux/epoll_event_loop.c" > $TMPFILE
2020
md5sum --check $TMPFILE
2121
2222
# No further steps if successful

tests/vcc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ NO_CHANGE_FILE=source/linux/epoll_event_loop.c
2222
$(VCC) $(VCC_ARGS) process_task_pre_queue.c /f:s_process_task_pre_queue
2323
$(VCC) $(VCC_ARGS) lifecycle.c /f:s_stop_task /f:s_stop /f:s_wait_for_stop_completion /f:s_run
2424
$(VCC) $(VCC_ARGS) main_loop.c /f:s_on_tasks_to_schedule /f:s_main_loop
25-
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_default
26-
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_destroy /p:"-DUSE_EFD=0"
27-
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_destroy /p:"-DUSE_EFD=1"
25+
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_default /f:s_start_destroy
26+
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_complete_destroy /p:"-DUSE_EFD=0"
27+
$(VCC) $(VCC_ARGS) new_destroy.c /f:aws_event_loop_new_with_epoll /f:s_complete_destroy /p:"-DUSE_EFD=1"
2828
$(VCC) $(VCC_ARGS) client.c /f:test_new_destroy /f:test_subscribe_unsubscribe
2929

3030
.phony: all

tests/vcc/client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ void test_new_destroy()
3737
if (!event_loop) return;
3838
_(ghost \claim c_event_loop;)
3939
_(ghost c_event_loop = \make_claim({event_loop}, event_loop->\closed);)
40-
s_destroy(event_loop _(ghost c_event_loop) _(ghost c_mutex));
40+
s_start_destroy(event_loop _(ghost c_event_loop) _(ghost c_mutex));
41+
s_complete_destroy(event_loop _(ghost c_event_loop) _(ghost c_mutex));
4142
}
4243

4344
void on_event(

tests/vcc/new_destroy.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,17 @@ struct aws_event_loop *aws_event_loop_new_with_epoll(
249249
return NULL;
250250
}
251251

252+
static void s_start_destroy(struct aws_event_loop *event_loop
253+
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
254+
) {
255+
(void)event_loop;
256+
}
257+
252258
/* Fake-up call to s_stop since this is just a vtable lookup */
253259
#define aws_event_loop_stop(event_loop) \
254260
s_stop(event_loop _(ghost c_event_loop) _(ghost c_mutex));
255261

256-
static void s_destroy(struct aws_event_loop *event_loop
262+
static void s_complete_destroy(struct aws_event_loop *event_loop
257263
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
258264
) {
259265
AWS_LOGF_INFO(AWS_LS_IO_EVENT_LOOP, "id=%p: Destroying event_loop", (void *)event_loop);

tests/vcc/preamble.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,20 @@ struct aws_event_loop *aws_event_loop_new_with_epoll(
827827
\fresh(c_mutex) && \wrapped0(c_mutex) && \claims_object(c_mutex, &(epoll_loop_of(\result)->task_pre_queue_mutex))))
828828
;
829829

830-
static void s_destroy(struct aws_event_loop *event_loop
830+
static void s_start_destroy(struct aws_event_loop *event_loop
831+
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
832+
)
833+
_(requires \malloc_root(event_loop))
834+
_(requires \malloc_root(epoll_loop_of(event_loop)))
835+
_(requires c_event_loop != c_mutex)
836+
_(requires \wrapped0(c_event_loop) && \claims_object(c_event_loop, event_loop))
837+
_(requires \wrapped0(c_mutex) && \claims_object(c_mutex, &epoll_loop_of(event_loop)->task_pre_queue_mutex))
838+
_(requires \wrapped(&epoll_loop_of(event_loop)->scheduler))
839+
_(requires \wrapped(epoll_loop_of(event_loop)::status))
840+
_(requires \wrapped(&epoll_loop_of(event_loop)->stop_task))
841+
;
842+
843+
static void s_complete_destroy(struct aws_event_loop *event_loop
831844
_(ghost \claim(c_event_loop)) _(ghost \claim(c_mutex))
832845
)
833846
_(requires \malloc_root(event_loop))

0 commit comments

Comments
 (0)