mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-04 07:38:47 +00:00 
			
		
		
		
	Service/DSP: implement semaphore event
This commit is contained in:
		
							parent
							
								
									6f6ffceec4
								
							
						
					
					
						commit
						92e5c51adb
					
				
					 4 changed files with 20 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -86,10 +86,17 @@ void WaitObject::WakeupAllWaitingThreads() {
 | 
			
		|||
 | 
			
		||||
        thread->ResumeFromWait();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (hle_notifier)
 | 
			
		||||
        hle_notifier();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const std::vector<SharedPtr<Thread>>& WaitObject::GetWaitingThreads() const {
 | 
			
		||||
    return waiting_threads;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WaitObject::SetHLENotifier(std::function<void()> callback) {
 | 
			
		||||
    hle_notifier = callback;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace Kernel
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@
 | 
			
		|||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <functional>
 | 
			
		||||
#include <vector>
 | 
			
		||||
#include <boost/smart_ptr/intrusive_ptr.hpp>
 | 
			
		||||
#include "common/common_types.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -52,9 +53,15 @@ public:
 | 
			
		|||
    /// Get a const reference to the waiting threads list for debug use
 | 
			
		||||
    const std::vector<SharedPtr<Thread>>& GetWaitingThreads() const;
 | 
			
		||||
 | 
			
		||||
    /// Sets a callback which is called when the object becomes available
 | 
			
		||||
    void SetHLENotifier(std::function<void()> callback);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    /// Threads waiting for this object to become available
 | 
			
		||||
    std::vector<SharedPtr<Thread>> waiting_threads;
 | 
			
		||||
 | 
			
		||||
    /// Function to call when this object becomes available
 | 
			
		||||
    std::function<void()> hle_notifier;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Specialization of DynamicObjectCast for WaitObjects
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue