From 9b63e7fe7df2d3925a31779ae9eca72404de28c9 Mon Sep 17 00:00:00 2001 From: coderstephen Date: Sat, 1 Aug 2015 21:18:14 -0500 Subject: [PATCH] A mutex based on the sync extension --- src/Sync/ExtSyncMutex.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Sync/ExtSyncMutex.php diff --git a/src/Sync/ExtSyncMutex.php b/src/Sync/ExtSyncMutex.php new file mode 100644 index 0000000..3cd986c --- /dev/null +++ b/src/Sync/ExtSyncMutex.php @@ -0,0 +1,39 @@ +mutex = new \SyncMutex(); + } + + /** + * {@inheritdoc} + */ + public function lock() + { + $this->mutex->lock(-1); + } + + /** + * {@inheritdoc} + */ + public function unlock() + { + $this->mutex->unlock(false); + } +}