by MichaelGG · 11y ago · 0 comments
Which languages do that? Other than requiring all functions to require a "mainthread" reference (perhaps a zero-sized type that lacks the traits to be sent cross-thread) are there ways to achieve this in general?
And if you want it to be optional, like "if mainthread", then just accept an Option of MainThread.
In fact I see exactly this is proposed in the comments on the article: https://users.rust-lang.org/t/my-gamedever-wishlist-for-rust...