You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			30 lines
		
	
	
		
			742 B
		
	
	
	
		
			C++
		
	
			
		
		
	
	
			30 lines
		
	
	
		
			742 B
		
	
	
	
		
			C++
		
	
| #include "bellringer.h"
 | |
| 
 | |
| #include "../interrupt/guard.h"
 | |
| #include "../thread/thread.h"
 | |
| 
 | |
| struct Bell {
 | |
|   // link pointer to the next bell in the bellringers bell list
 | |
|   Bell *queue_link[1] = {nullptr};
 | |
| 
 | |
|   Thread *thread;
 | |
|   size_t counter;
 | |
| };
 | |
| 
 | |
| Bell **Bellringer::bell_link(Bell &obj, unsigned link_index) {
 | |
|   return &obj.queue_link[link_index];
 | |
| }
 | |
| 
 | |
| // check: Checks whether bells are running out of time and rings them if
 | |
| // necessary
 | |
| void Bellringer::check(Vault &vault) { (void)vault; }
 | |
| 
 | |
| // job: Give a bell to the bellringer & ring it when the specified time ran out.
 | |
| void Bellringer::sleep(Vault &vault, unsigned int ms) {
 | |
|   (void)vault;
 | |
|   (void)ms;
 | |
| }
 | |
| 
 | |
| // Are there bells in the queue?
 | |
| bool Bellringer::bellPending() const { return false; }
 |