aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-04-19 15:46:06 +0200
committerLoïc Hoguin <[email protected]>2017-04-19 15:46:06 +0200
commit6783a9aa8370c0d4e5d45462709f3f50557caab1 (patch)
tree27da5e35d9c7227ebdb6d4142a22f2ab2a9b0fac
parent1ea180459b74165036eea638f61f78e688867eac (diff)
downloadesdl2-6783a9aa8370c0d4e5d45462709f3f50557caab1.tar.gz
esdl2-6783a9aa8370c0d4e5d45462709f3f50557caab1.tar.bz2
esdl2-6783a9aa8370c0d4e5d45462709f3f50557caab1.zip
Update comment
-rw-r--r--c_src/nif_helpers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/c_src/nif_helpers.c b/c_src/nif_helpers.c
index 8953f2e..f29d76d 100644
--- a/c_src/nif_helpers.c
+++ b/c_src/nif_helpers.c
@@ -169,8 +169,9 @@ void* nif_create_main_thread(char* name)
TAILQ_INIT(st->mailbox);
#if defined(__APPLE__) && defined(__MACH__)
- // On OSX, SDL2 must run in the main thread, otherwise some operations
- // will not work properly. For example, input events would not be received.
+ // On OSX we identify ourselves as the main thread to ensure that
+ // we are compatible with libraries that require it. For example
+ // this is necessary with SDL2 in order to receive input events.
erl_drv_steal_main_thread(name, &(st->tid), nif_main_thread, st, NULL);
#else
enif_thread_create(name, &(st->tid), nif_main_thread, st, NULL);