summaryrefslogtreecommitdiff
path: root/src/thread/thread.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-02-16 21:37:05 +0000
committerfrosch <frosch@openttd.org>2014-02-16 21:37:05 +0000
commit7ac18c0f22bcd62feede693be2617264eb5decf6 (patch)
tree9e19c462079a70919f6fa2c9616b04639251cbe8 /src/thread/thread.h
parentb2ca2e297933c52e42f74b51c3f59b024ccb3772 (diff)
downloadopenttd-7ac18c0f22bcd62feede693be2617264eb5decf6.tar.xz
(svn r26349) -Add: Optional recursive locking of mutexes.
Diffstat (limited to 'src/thread/thread.h')
-rw-r--r--src/thread/thread.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/thread/thread.h b/src/thread/thread.h
index a98dfb223..b944a53b9 100644
--- a/src/thread/thread.h
+++ b/src/thread/thread.h
@@ -66,13 +66,19 @@ public:
/**
* Begin the critical section
+ * @param allow_recursive Whether recursive locking is intentional.
+ * If false, NOT_REACHED() will be called when the mutex is already locked
+ * by the current thread.
*/
- virtual void BeginCritical() = 0;
+ virtual void BeginCritical(bool allow_recursive = false) = 0;
/**
* End of the critical section
+ * @param allow_recursive Whether recursive unlocking is intentional.
+ * If false, NOT_REACHED() will be called when the mutex was locked more
+ * than once by the current thread.
*/
- virtual void EndCritical() = 0;
+ virtual void EndCritical(bool allow_recursive = false) = 0;
/**
* Wait for a signal to be send.