mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-03 23:21:15 +00:00 
			
		
		
		
	Modernize atomics
- Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
This commit is contained in:
		
							parent
							
								
									8870f43d74
								
							
						
					
					
						commit
						8e128726f0
					
				
					 58 changed files with 650 additions and 639 deletions
				
			
		| 
						 | 
				
			
			@ -187,14 +187,14 @@ String GodotIOJavaWrapper::get_system_dir(int p_dir) {
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// volatile because it can be changed from non-main thread and we need to
 | 
			
		||||
// SafeNumeric because it can be changed from non-main thread and we need to
 | 
			
		||||
// ensure the change is immediately visible to other threads.
 | 
			
		||||
static volatile int virtual_keyboard_height;
 | 
			
		||||
static SafeNumeric<int> virtual_keyboard_height;
 | 
			
		||||
 | 
			
		||||
int GodotIOJavaWrapper::get_vk_height() {
 | 
			
		||||
	return virtual_keyboard_height;
 | 
			
		||||
	return virtual_keyboard_height.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void GodotIOJavaWrapper::set_vk_height(int p_height) {
 | 
			
		||||
	virtual_keyboard_height = p_height;
 | 
			
		||||
	virtual_keyboard_height.set(p_height);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue