diff options
Diffstat (limited to 'src/rt/sync/fair_ticket_lock.h')
| -rw-r--r-- | src/rt/sync/fair_ticket_lock.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rt/sync/fair_ticket_lock.h b/src/rt/sync/fair_ticket_lock.h new file mode 100644 index 00000000..c34c9041 --- /dev/null +++ b/src/rt/sync/fair_ticket_lock.h @@ -0,0 +1,15 @@ +#ifndef FAIR_TICKET_LOCK_H +#define FAIR_TICKET_LOCK_H + +class fair_ticket_lock { + unsigned next_ticket; + unsigned now_serving; + void pause(); +public: + fair_ticket_lock(); + virtual ~fair_ticket_lock(); + void lock(); + void unlock(); +}; + +#endif /* FAIR_TICKET_LOCK_H */ |