-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use c++11 primitives for threads and locks
- Loading branch information
Showing
17 changed files
with
34 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
#ifndef EFSW_LOCK_HPP | ||
#define EFSW_LOCK_HPP | ||
|
||
#include <mutex> | ||
#include <efsw/Mutex.hpp> | ||
|
||
namespace efsw { | ||
|
||
/** Simple mutex class */ | ||
class Lock { | ||
public: | ||
explicit Lock( Mutex& mutex ) : mMutex( mutex ) { mMutex.lock(); } | ||
|
||
~Lock() { mMutex.unlock(); } | ||
|
||
private: | ||
Mutex& mMutex; | ||
}; | ||
|
||
using Lock = std::unique_lock<Mutex>; | ||
} // namespace efsw | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
#ifndef EFSW_MUTEX_HPP | ||
#define EFSW_MUTEX_HPP | ||
|
||
#include <efsw/base.hpp> | ||
#include <mutex> | ||
|
||
namespace efsw { | ||
|
||
namespace Platform { | ||
class MutexImpl; | ||
} | ||
|
||
/** Simple mutex class */ | ||
class Mutex { | ||
public: | ||
Mutex(); | ||
|
||
~Mutex(); | ||
|
||
/** Lock the mutex */ | ||
void lock(); | ||
|
||
/** Unlock the mutex */ | ||
void unlock(); | ||
|
||
private: | ||
Platform::MutexImpl* mMutexImpl; | ||
}; | ||
|
||
using Mutex = std::mutex; | ||
} // namespace efsw | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.