Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
net_instaweb::SharedMemLockManager Class Reference

namespace SharedMemLockData More...

#include "shared_mem_lock_manager.h"

Inheritance diagram for net_instaweb::SharedMemLockManager:

Public Member Functions

 SharedMemLockManager (AbstractSharedMem *shm, const GoogleString &path, Scheduler *scheduler, Hasher *hasher, MessageHandler *handler)
bool Initialize ()
bool Attach ()
CreateNamedLock (const StringPiece &name)

Static Public Member Functions

static void GlobalCleanup (AbstractSharedMem *shm, const GoogleString &path, MessageHandler *message_handler)


class SharedMemLock

Detailed Description

namespace SharedMemLockData

A simple shared memory named locking manager, which uses scheduler alarms (via SchedulerBasedAbstractLock) when it needs to block.

TODO(morlovich): Implement condvars?

Constructor & Destructor Documentation

net_instaweb::SharedMemLockManager::SharedMemLockManager ( AbstractSharedMem shm,
const GoogleString path,
Scheduler scheduler,
Hasher hasher,
MessageHandler handler 

Note that you must call Initialize() in the root process, and Attach in child processes to finish the initialization.

Locks created by this object must not live after it dies.

Member Function Documentation

bool net_instaweb::SharedMemLockManager::Attach ( )

Connects to already initialized state from a child process. Returns whether successful.

static void net_instaweb::SharedMemLockManager::GlobalCleanup ( AbstractSharedMem shm,
const GoogleString path,
MessageHandler message_handler 

This should be called from the root process as it is about to exit, with the same value as were passed to the constructor of any instance on which Initialize() was called, except the message_handler may be different (if for example the original one is no longer available due to the cleanup sequence).

bool net_instaweb::SharedMemLockManager::Initialize ( )

Sets up our shared state for use of all child processes. Returns whether successful.

The documentation for this class was generated from the following file: