diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-12-23 16:22:45 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2009-12-23 16:22:45 +0100 |
| commit | bba4dec6bbe08a1f0c0c2b73c4b8e62aa8ded2df (patch) | |
| tree | 8fa18140ea0a4cd6a7d73c64e24dd2e42ea3d600 /lib/base/elock.h | |
| parent | a95987bbd88eb84db03a431826d4b21cb7725a0f (diff) | |
| parent | b64b791cb481944585fceaf5bcac9e2c699dbeb0 (diff) | |
| download | enigma2-bba4dec6bbe08a1f0c0c2b73c4b8e62aa8ded2df.tar.gz enigma2-bba4dec6bbe08a1f0c0c2b73c4b8e62aa8ded2df.zip | |
Merge branch 'bug_355_seek_fixes'
Diffstat (limited to 'lib/base/elock.h')
| -rw-r--r-- | lib/base/elock.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/base/elock.h b/lib/base/elock.h index 51582e67..01757182 100644 --- a/lib/base/elock.h +++ b/lib/base/elock.h @@ -83,9 +83,18 @@ class eSingleLock pthread_mutex_t m_lock; eSingleLock(eSingleLock &); public: - eSingleLock() + eSingleLock(bool recursive=false) { - pthread_mutex_init(&m_lock, 0); + if (recursive) + { + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&m_lock, &attr); + pthread_mutexattr_destroy(&attr); + } + else + pthread_mutex_init(&m_lock, 0); } ~eSingleLock() { |
