forked from Bananymous/banan-os
				
			Kernel: Add is_locked() to spinlock
I think this is atomic read
This commit is contained in:
		
							parent
							
								
									01f267a321
								
							
						
					
					
						commit
						f6b05212e0
					
				| 
						 | 
				
			
			@ -14,6 +14,7 @@ namespace Kernel
 | 
			
		|||
		SpinLock() = default;
 | 
			
		||||
		void lock();
 | 
			
		||||
		void unlock();
 | 
			
		||||
		bool is_locked() const;
 | 
			
		||||
 | 
			
		||||
	private:
 | 
			
		||||
		int m_lock = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,4 +16,9 @@ namespace Kernel
 | 
			
		|||
		spinlock_unlock_asm(&m_lock);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	bool SpinLock::is_locked() const
 | 
			
		||||
	{
 | 
			
		||||
		return m_lock;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue