Closed rtibbles closed 1 year ago
This is technically an issue in Python For Android, but easier to track here. We are currently using an integer to track whether Python has initialized, but this may run into concurrency issues without any sort of mutex.
We should initialize Python in a completely concurrency safe way - the best way to do this seems to be by using pthread_once: https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_74/apis/users_27.htm
Fixed in 26f4d24b9a3315ec6a211b08471c674a8ece4b27
Observed behavior
This is technically an issue in Python For Android, but easier to track here. We are currently using an integer to track whether Python has initialized, but this may run into concurrency issues without any sort of mutex.
Expected behavior
We should initialize Python in a completely concurrency safe way - the best way to do this seems to be by using pthread_once: https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_74/apis/users_27.htm