learningequality / kolibri-installer-android

Android wrapper for Kolibri.
MIT License
26 stars 22 forks source link

Use pthread_once to allow concurrency safe Python initialization #149

Closed rtibbles closed 1 year ago

rtibbles commented 1 year ago

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

rtibbles commented 1 year ago

Fixed in 26f4d24b9a3315ec6a211b08471c674a8ece4b27