You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to figure out how to do this - my problem is I have a TLS that contains some database connections that are live for the duration of the thread. What I would like do is, when the thread is being destroyed, take the value out of TLS so I can drop it (otherwise, the value just lives forever in TLS and is never cleaned up).
The only thing that seems to work is Mutex<Option<T>>, but reaching for a Mutex here seems like overkill. RefCell/Rc doesn't work because of the Send requirement. Anything I might be overlooking here?
The text was updated successfully, but these errors were encountered:
I'm trying to figure out how to do this - my problem is I have a TLS that contains some database connections that are live for the duration of the thread. What I would like do is, when the thread is being destroyed, take the value out of TLS so I can drop it (otherwise, the value just lives forever in TLS and is never cleaned up).
The only thing that seems to work is
Mutex<Option<T>>
, but reaching for a Mutex here seems like overkill.RefCell
/Rc
doesn't work because of theSend
requirement. Anything I might be overlooking here?The text was updated successfully, but these errors were encountered: