added NullMutex, extended Events so that mutex is a template param, minor performance optimzation for strategies

This commit is contained in:
Peter Schojer
2008-09-30 06:26:47 +00:00
parent ce17ae2c66
commit 358797c89e
11 changed files with 104 additions and 19 deletions

View File

@@ -166,6 +166,55 @@ private:
};
class Foundation_API NullMutex
/// 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
{
public:
typedef Poco::ScopedLock<NullMutex> ScopedLock;
NullMutex()
/// creates the NullMutex.
{
}
~NullMutex()
/// destroys the NullMutex.
{
}
void lock()
/// Always succeeds
{
}
void lock(long milliseconds)
/// Always succeeds
{
}
bool tryLock()
/// Always returns true
{
return true;
}
bool tryLock(long)
/// Always returns true
{
return true;
}
void unlock()
/// Always succeeds
{
}
};
//
// inlines
//