Honeycomb  0.1
Component-Model Framework
Mutex.h
Go to the documentation of this file.
1 // Honeycomb, Copyright (C) 2014 NewGamePlus Inc. Distributed under the Boost Software License v1.0.
2 #pragma once
3 
5 namespace honey { namespace platform
6 {
7 
9 class Mutex
10 {
11 public:
12  typedef pthread_mutex_t Handle;
13 
14  Mutex();
15  virtual ~Mutex();
16 
17  void lock();
18  void unlock();
19  bool tryLock();
20 
21  Handle& handle() { return _handle; }
22 
23 private:
24  Handle _handle;
25 };
26 
27 } }
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