-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
A data race bug #13795
Copy link
Copy link
Closed
Labels
Description
Hi, lock gx_stop_dev_thread is used to protect gx_stop_dev_thread. However, while(!gx_stop_dev_thread) at Line 128 in the method gx_devthread is not protected by the lock.
RetroArch/frontend/drivers/platform_gx.c
Lines 124 to 155 in 4a53c67
| static void gx_devthread(void *a) | |
| { | |
| unsigned i; | |
| while (!gx_stop_dev_thread) | |
| { | |
| slock_lock(gx_device_mutex); | |
| for (i = 0; i < GX_DEVICE_END; i++) | |
| { | |
| if (gx_devices[i].mounted) | |
| { | |
| if (!gx_devices[i].interface->isInserted()) | |
| { | |
| char n[8] = {0}; | |
| gx_devices[i].mounted = false; | |
| snprintf(n, sizeof(n), "%s:", gx_devices[i].name); | |
| fatUnmount(n); | |
| } | |
| } | |
| else if (gx_devices[i].interface->startup() && gx_devices[i].interface->isInserted()) | |
| gx_devices[i].mounted = fatMountSimple(gx_devices[i].name, gx_devices[i].interface); | |
| } | |
| slock_unlock(gx_device_mutex); | |
| slock_lock(gx_device_cond_mutex); | |
| scond_wait_timeout(gx_device_cond, gx_device_cond_mutex, 1000000); | |
| slock_unlock(gx_device_cond_mutex); | |
| } | |
| } |
RetroArch/frontend/drivers/platform_gx.c
Lines 364 to 375 in 4a53c67
| static void frontend_gx_deinit(void *data) | |
| { | |
| (void)data; | |
| #if defined(HW_RVL) && !defined(IS_SALAMANDER) | |
| slock_lock(gx_device_cond_mutex); | |
| gx_stop_dev_thread = true; | |
| slock_unlock(gx_device_cond_mutex); | |
| scond_signal(gx_device_cond); | |
| sthread_join(gx_device_thread); | |
| #endif | |
| } |
Reactions are currently unavailable