Honeycomb  0.1
Component-Model Framework
Mutex.h
Go to the documentation of this file.
1 // Honeycomb, Copyright (C) 2015 NewGamePlus Inc. Distributed under the Boost Software License v1.0.
2 #pragma once
3 
5 namespace honey { namespace platform
6 {
7 
8 class Mutex
9 {
10 public:
11  typedef pthread_mutex_t Handle;
12 
13  Mutex();
14  virtual ~Mutex();
15 
16  void lock();
17  void unlock();
18  bool tryLock();
19 
20  Handle& handle() { return _handle; }
21 
22 private:
23  Handle _handle;
24 };
25 
26 } }
void lock(Locks &&...locks)
Lock all lockables safely without deadlocking.
Definition: Util.h:110
Global Honeycomb namespace.
int tryLock(Lock &l, Locks &...ls)
Try to lock all lockables. Locks either all or none.
Definition: Util.h:26