mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-31 07:59:02 -05:00 
			
		
		
		
	Kernel: Corrections to Wait Objects clearing in which a thread could still be signalled after a timeout or a cancel.
This commit is contained in:
		 Fernando Sahmkow
					Fernando Sahmkow
				
			
				
					committed by
					
						 FernandoS27
						FernandoS27
					
				
			
			
				
	
			
			
			 FernandoS27
						FernandoS27
					
				
			
						parent
						
							27d571c084
						
					
				
				
					commit
					1c6a11ab14
				
			| @@ -133,6 +133,7 @@ void Thread::ResumeFromWait() { | ||||
|  | ||||
| void Thread::CancelWait() { | ||||
|     ASSERT(GetStatus() == ThreadStatus::WaitSynch); | ||||
|     ClearWaitObjects(); | ||||
|     SetWaitSynchronizationResult(ERR_SYNCHRONIZATION_CANCELED); | ||||
|     ResumeFromWait(); | ||||
| } | ||||
|   | ||||
| @@ -319,6 +319,9 @@ public: | ||||
|     } | ||||
|  | ||||
|     void ClearWaitObjects() { | ||||
|         for (const auto& waiting_object : wait_objects) { | ||||
|             waiting_object->RemoveWaitingThread(this); | ||||
|         } | ||||
|         wait_objects.clear(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -85,9 +85,6 @@ void WaitObject::WakeupWaitingThread(SharedPtr<Thread> thread) { | ||||
|  | ||||
|     const std::size_t index = thread->GetWaitObjectIndex(this); | ||||
|  | ||||
|     for (const auto& object : thread->GetWaitObjects()) { | ||||
|         object->RemoveWaitingThread(thread.get()); | ||||
|     } | ||||
|     thread->ClearWaitObjects(); | ||||
|  | ||||
|     thread->CancelWakeupTimer(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user