Replying to Avatar average_bitcoiner

Good morning.

Remember kids, if you have a MutexGuard, you have to drop that shit before doing async things so you're not trying to lock the Mutex during the async call. But don't use the function 'drop()'. Use curly braces to make a scope. Within that scope, clone that bitch out of there into a variable outside the scope then do async shit.

#rust #devstr

Avatar
sommerfeld 1y ago

If you're just cloning it, why use a mutex at all? Might as well do a copy for each thread 😅

Reply to this note

Please Login to reply.

Discussion

No replies yet.