Skip to content

C++/WinRT coroutine locals may return/complete before locals are destroyed#116

Merged
kennykerr merged 30 commits into
masterfrom
kennykerr2
Jan 10, 2019
Merged

C++/WinRT coroutine locals may return/complete before locals are destroyed#116
kennykerr merged 30 commits into
masterfrom
kennykerr2

Conversation

@kennykerr

Copy link
Copy Markdown
Contributor

@JamesMcNellis recently discovered that the traditional way of implementing a coroutine type may allow locals within the coroutine to be destroyed after the coroutine returns/completes (rather than prior to final suspension). @GorNishanov clarified that the resumption of any waiter should be deferred until final suspension to avoid this problem (among other benefits).

This update fixes this problem for C++/WinRT coroutines and also ports over all of the existing coroutine tests from out internal repo. New tests have been added to detect this issue as well.

I wish I could port over VSO's vastly superior PR viewer as well. 🙁

Comment thread src/test/cpp/test/AsyncLocal.cpp Outdated
Comment thread src/test/cpp/test/AsyncLocal.cpp Outdated
Comment thread src/test/cpp/test/AsyncResult.cpp
Comment thread src/tool/cpp/cppwinrt/strings/base_await.h Outdated
Comment thread src/tool/cpp/cppwinrt/strings/base_std_async_action.h
Comment thread src/tool/cpp/cppwinrt/strings/base_std_async_operation.h Outdated
Comment thread src/tool/cpp/cppwinrt/strings/base_std_async_operation_with_progress.h Outdated
Comment thread src/tool/cpp/cppwinrt/strings/base_std_async_operation_with_progress.h Outdated
Comment thread src/tool/cpp/cppwinrt/strings/base_std_async_operation.h Outdated
@devhawk

devhawk commented Jan 9, 2019

Copy link
Copy Markdown
Contributor

Independent of anything specific to this PR, can I just say how much I appreciate @GorNishanov's feedback!

@kennykerr kennykerr merged commit c79e07a into master Jan 10, 2019
@kennykerr kennykerr deleted the kennykerr2 branch January 10, 2019 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants