How to make network requests safely?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By alexzheng
:warning: Old Version Published before Godot 3 was released.

I make ads load requests and show ads from my scripts, but sometimes it may cause crash said:
_WebTryThreadLock(bool), 0x17001ea90: Multiple locks on web thread not allowed! Please file a bug. Crashing now…

the load request is defined in a module.

alexzheng | 2017-09-25 02:37

I debug my code, all my requests are made on the main thread.

alexzheng | 2017-09-25 03:11