-
Notifications
You must be signed in to change notification settings - Fork 19
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
Automatic sync - sync worker #1207
Conversation
xmtp_mls/src/groups/mod.rs
Outdated
@@ -228,6 +228,10 @@ pub struct MlsGroup<C> { | |||
mutex: Arc<Mutex<()>>, | |||
} | |||
|
|||
// C is wrapped in an Arc, and so is the Mutex, so this is fine. | |||
unsafe impl<C> Send for MlsGroup<C> {} | |||
unsafe impl<C> Sync for MlsGroup<C> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@insipx This is so we can use this feature on wasm since the Client is neither Send nor Sync there. Everything in MlsGroup that isn't Send/Sync already is wrapped in an Arc, so this should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is only for wasm, we should have it under #[cfg(target_arch = "wasm32")]
xmtp_mls/src/groups/mod.rs
Outdated
@@ -228,6 +228,10 @@ pub struct MlsGroup<C> { | |||
mutex: Arc<Mutex<()>>, | |||
} | |||
|
|||
// C is wrapped in an Arc, and so is the Mutex, so this is fine. | |||
unsafe impl<C> Send for MlsGroup<C> {} | |||
unsafe impl<C> Sync for MlsGroup<C> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is only for wasm, we should have it under #[cfg(target_arch = "wasm32")]
I tested this in the android SDK and works like expected 🎉 |
cd5688e
to
0a2fcc8
Compare
4cce5fe
to
d7aaf40
Compare
No description provided.