Skip to content

Thread Safe Decorator <Help Wanted> #2598

Answered by mejrs
zachcoleman asked this question in Questions
Discussion options

You must be logged in to vote

i.e. call is not atomic and so two calls to this method are happening at the same time

I think that this is the case, and that the executor is yielding in the middle of the hello function. If another function then goes through __call__ and attempts to mutably borrow the decorator, it detects the outstanding borrow. This is not a problem with the changes you have made, because having multiple &self borrows is fine.

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@davidhewitt
Comment options

@zachcoleman
Comment options

Comment options

You must be logged in to vote
2 replies
@mejrs
Comment options

@zachcoleman
Comment options

Answer selected by zachcoleman
Comment options

You must be logged in to vote
3 replies
@mejrs
Comment options

@zachcoleman
Comment options

@mejrs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants