summaryrefslogtreecommitdiffstats
path: root/base/shared_memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/shared_memory.h')
-rw-r--r--base/shared_memory.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 79ea8fd..719eb69 100644
--- a/base/shared_memory.h
+++ b/base/shared_memory.h
@@ -43,6 +43,13 @@ class SharedMemory {
public:
SharedMemory();
+#if defined(OS_WIN)
+ // Similar to the default constructor, except that this allows for
+ // calling Lock() to acquire the named mutex before either Create or Open
+ // are called on Windows.
+ explicit SharedMemory(const std::wstring& name);
+#endif
+
// Create a new SharedMemory object from an existing, open
// shared memory file.
SharedMemory(SharedMemoryHandle handle, bool read_only);
@@ -165,6 +172,12 @@ class SharedMemory {
// across Mac and Linux.
void Lock();
+#if defined(OS_WIN)
+ // A Lock() implementation with a timeout. Returns true if the Lock() has
+ // been acquired, false if the timeout was reached.
+ bool Lock(uint32 timeout_ms);
+#endif
+
// Releases the shared memory lock.
void Unlock();