Poco

class NullMutex

Library: Foundation
Package: Threading
Header: Poco/Mutex.h

Description

A NullMutex is an empty mutex implementation which performs no locking at all. Useful in policy driven design where the type of mutex used can be now a template parameter allowing the user to switch between thread-safe and not thread-safe depending on his need Works with the ScopedLock class

Member Summary

Member Functions: lock, tryLock, unlock

Types Aliases

ScopedLock

using ScopedLock = Poco::ScopedLock < NullMutex >;

ScopedLockWithUnlock

using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock < NullMutex >;

Constructors

NullMutex inline

NullMutex();

Creates the NullMutex.

Destructor

~NullMutex inline

~NullMutex();

Destroys the NullMutex.

Member Functions

lock inline

void lock();

Does nothing.

lock inline

void lock(
    long
);

Does nothing.

tryLock inline

bool tryLock();

Does nothing and always returns true.

tryLock inline

bool tryLock(
    long
);

Does nothing and always returns true.

unlock inline

void unlock();

Does nothing.