Yep. My understanding of locking the OS thread from an init() was wrong. I 
think I have it working now. Thanks guys!

On Tue, Dec 17, 2019, at 9:37 AM, Ian Davis wrote:
> 
> 
> On Sat, 14 Dec 2019, at 7:51 PM, bucha...@gmail.com wrote:
>> If I understand correctly, that would prevent me from starting any other 
>> goroutines. The following program deadlocks:
> 
> I doesn't prevent you starting other goroutines but you need to ensure that 
> all calls to the OpenGL context are performed on the thread you initialised 
> it with (my understanding is that this is because OpenGL uses thread local 
> storage). Typically you can do this by sending closures containing OpenGL 
> calls via a channel to an executor running in a goroutine locked to the main 
> thread. There is/was an example of this in the gomobile codebase. I can share 
> more detail if you get stuck.
> 
> -- Ian
> 
> 
> 

> --
>  You received this message because you are subscribed to a topic in the 
> Google Groups "golang-nuts" group.
>  To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/golang-nuts/zAB8Si7EMVM/unsubscribe.
>  To unsubscribe from this group and all its topics, send an email to 
> golang-nuts+unsubscr...@googlegroups.com.
>  To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/0adcdc5a-dd2c-4506-9110-a3ecabc508b9%40www.fastmail.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/0adcdc5a-dd2c-4506-9110-a3ecabc508b9%40www.fastmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a90ad587-495c-4edf-bbc1-82491f2e6238%40www.fastmail.com.

Reply via email to