mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-10-31 04:31:57 +00:00 
			
		
		
		
	[c-host] fix deadlock when there is no update
This commit is contained in:
		| @@ -71,8 +71,8 @@ static int pointerThread(void * opaque) | ||||
|     pointer->data = app.pointerData; | ||||
|     if (!app.iface->getPointer(&pointer)) | ||||
|       DEBUG_ERROR("Failed to get the pointer"); | ||||
|     os_signalEvent(app.updateEvent); | ||||
| #endif | ||||
|     os_signalEvent(app.updateEvent); | ||||
|   } | ||||
|  | ||||
|   DEBUG_INFO("Cursor thread stopped"); | ||||
| @@ -303,6 +303,7 @@ int app_main() | ||||
|     bool frameUpdate   = false; | ||||
|     bool pointerUpdate = false; | ||||
|  | ||||
| retry_capture: | ||||
|     switch(iface->capture(&frameUpdate, &pointerUpdate)) | ||||
|     { | ||||
|       case CAPTURE_RESULT_OK: | ||||
| @@ -342,6 +343,9 @@ int app_main() | ||||
|         goto finish; | ||||
|     } | ||||
|  | ||||
|     if (!frameUpdate && !pointerUpdate) | ||||
|       goto retry_capture; | ||||
|  | ||||
|     if (frameUpdate && !os_signalEvent(app.frameEvent)) | ||||
|     { | ||||
|       DEBUG_ERROR("Failed to signal the frame thread"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Geoffrey McRae
					Geoffrey McRae