Skip to content

Fix thread join

Ouinet Bot requested to merge fix-thread-join into master

Created by: paidforby

This PR partially reverts the fixes made in ouinet v0.21.3 for the error thread::join failed: Invalid argument, instead of relying on the getState function, which isn't synchronized, it checks that the g_client_thread.get_id method does not return the default thread id (i.e. it has been initialized and is, therefore, able to have it's stop method called.

Additionally, it completely reverts the fix applied in v0.21.4 which attempted to avoid issues registering and unregistering broadcast receivers by simply removing them. Instead, this error indicates a problem in the application (e.g. CENO) with how it is starting and stopping the ouinet client. I've added the receivers back to the ouinet code (even though they are essentially unused) and will apply a fix in CENO.

Both of these changes were suggested by @Inetic and should be reviewed.

Merge request reports