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

Allow PDB to impl Send. #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

afranchuk
Copy link

@afranchuk afranchuk commented Jul 6, 2023

This allows PDB to be used across await points in async blocks. It also enables Sync access by e.g. wrapping with a Mutex.

This results in just one API-breaking change, where the Source::view trait method must now return a boxed trait object which is Send + Sync. If this breakage is unacceptable, maybe these changes could be behind a feature?

@mstange
Copy link
Collaborator

mstange commented Sep 12, 2023

@jan-auer Could you take a look at this? It's needed for mstange/pdb-addr2line#63

@afranchuk
Copy link
Author

Bump @jan-auer, any chance of this getting in?

Comment on lines +68 to +69
where
S: Send,
Copy link
Collaborator

@mstange mstange May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried that not all consumers can provide a Send object as the parameter to PDB::open.

It would be nice if we could find a way to make PDB send whenever S is Send.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've seen ways of doing this with trait objects, though (if I am remembering correctly) they are understandably hacky/cumbersome. It would be easier if this didn't store a dyn Msf. There's only one implementation of that, so we could avoid the trait object fairly easily...

Copy link
Author

@afranchuk afranchuk May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH as of these changes, Source must be able to provide Send + Sync SourceViews, so I'd be surprised if Source was not at least Send too.

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.

2 participants