Run graal_attach_thread ahead of all calls
#1131
Merged
graal_attach_thread ahead of all calls
#1131