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

Equeue chain, add documentation of using equeue_destroy #11491

Merged
merged 2 commits into from
Sep 27, 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
2 changes: 1 addition & 1 deletion TESTS/events/equeue/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ static void test_equeue_chain()
TEST_ASSERT_EQUAL_UINT8(3, touched1);
TEST_ASSERT_EQUAL_UINT8(3, touched2);

equeue_destroy(&q1);
equeue_destroy(&q2);
equeue_destroy(&q1);
}

/** Test that unchaining equeues makes them work on their own.
Expand Down
2 changes: 1 addition & 1 deletion UNITTESTS/events/equeue/test_equeue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ TEST_F(TestEqueue, test_equeue_chain)
EXPECT_EQ(3, touched1);
EXPECT_EQ(3, touched2);

equeue_destroy(&q1);
equeue_destroy(&q2);
equeue_destroy(&q1);
}

/** Test that unchaining equeues makes them work on their own.
Expand Down
3 changes: 3 additions & 0 deletions events/equeue.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ typedef struct equeue {
//
// If the event queue creation fails, equeue_create returns a negative,
// platform-specific error code.
//
// If queues are chained, it is needed to unchain them first, before calling destroy,
// or call the destroy function on queues in order that chained queues are destroyed first.
int equeue_create(equeue_t *queue, size_t size);
int equeue_create_inplace(equeue_t *queue, size_t size, void *buffer);
void equeue_destroy(equeue_t *queue);
Expand Down
2 changes: 1 addition & 1 deletion events/source/tests/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ void chain_test(void)

test_assert(touched == 6);

equeue_destroy(&q1);
equeue_destroy(&q2);
equeue_destroy(&q1);
}

void unchain_test(void)
Expand Down