From c7064b31ce7ffa899693b51eb368559658f48c12 Mon Sep 17 00:00:00 2001 From: Joshua Yanovski Date: Fri, 9 Mar 2018 01:20:49 +0100 Subject: [PATCH] The Send impl for `FontContext` is too forgiving. I'm pretty confident that it is only thread safe if FK is (or another way of putting it is, I'm pretty sure if you include an `Rc<_>` in FK it should not be safe to share between threads). --- font-renderer/src/core_graphics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font-renderer/src/core_graphics.rs b/font-renderer/src/core_graphics.rs index 09afb67d..75779cdf 100644 --- a/font-renderer/src/core_graphics.rs +++ b/font-renderer/src/core_graphics.rs @@ -56,7 +56,7 @@ pub struct FontContext where FK: Clone + Hash + Eq + Ord { } // Core Text is thread-safe. -unsafe impl Send for FontContext where FK: Clone + Hash + Eq + Ord {} +unsafe impl Send for FontContext where FK: Clone + Hash + Eq + Ord + Send {} impl FontContext where FK: Clone + Hash + Eq + Ord { /// Creates a new font context instance.