SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
SLNet::SimpleMutex Class Reference

An easy to use mutex. More...

`#include <slikenet/SimpleMutex.h>`

## Public Member Functions

| SimpleMutex ()
| ~SimpleMutex ()
void | Lock (void)
void | Unlock (void)

## Detailed Description

An easy to use mutex.

I wrote this because the version that comes with Windows is too complicated and requires too much code to use.

Remarks
  Previously I used this everywhere, and in fact for a year or two RakNet was totally threadsafe. While doing profiling, I saw that this function was incredibly slow compared to the blazing performance of everything else, so switched to single producer / consumer everywhere. Now the user thread of RakNet is not threadsafe, but it's 100X faster than before.

Definition at line 45 of file SimpleMutex.h.

## Constructor & Destructor Documentation

SimpleMutex::SimpleMutex | ( |  | ) |

Definition at line 61 of file SimpleMutex.cpp.

SimpleMutex::~SimpleMutex | ( |  | ) |

Definition at line 74 of file SimpleMutex.cpp.

## Member Function Documentation

void SimpleMutex::Lock | ( | void |  | ) |

Definition at line 105 of file SimpleMutex.cpp.

References RakAssert.

Referenced by SLNet::RakPeer::AddPacketToProducer(), SLNet::RakPeer::AddToBanList(), SLNet::RakPeer::AddToSecurityExceptionList(), SLNet::RakPeer::AllocPacket(), SLNet::RakPeer::AllocRNS2RecvStruct(), SLNet::RakPeer::CancelConnectionAttempt(), SLNet::RakPeer::ClearBanList(), SLNet::RakPeer::ClearBufferedPackets(), SLNet::RakPeer::ClearRequestedConnectionList(), SLNet::RakString::Clone(), SLNet::RakPeer::DeallocatePacket(), SLNet::RakPeer::DeallocRNS2RecvStruct(), for(), SLNet::RakString::Free(), SLNet::RakPeer::GetConnectionState(), SLNet::RakPeer::GetNextSendReceipt(), SLNet::RakPeer::GetOfflinePingResponse(), SLNet::RakPeer::GetReceiveBufferSize(), SLNet::RakPeer::IncrementNextSendReceipt(), SLNet::RakPeer::IsBanned(), SLNet::RakPeer::IsInSecurityExceptionList(), SLNet::RakString::LockMutex(), operator+(), SLNet::RakString::operator=(), SLNet::RakPeer::PopBufferedPacket(), SLNet::ProcessOfflineNetworkPacket(), SLNet::RakPeer::PushBackPacket(), SLNet::RakPeer::PushBufferedPacket(), SLNet::RakString::RakString(), SLNet::RakPeer::Receive(), SLNet::RakPeer::RemoveFromBanList(), SLNet::RakPeer::RemoveFromSecurityExceptionList(), SLNet::RemoteClient::Reset(), SLNet::RakPeer::ResetSendReceipt(), SLNet::RakPeer::RunUpdateCycle(), SLNet::RakPeer::Send(), SLNet::RakPeer::SendConnectionRequest(), SLNet::SignaledEvent::SetEvent(), SLNet::RakPeer::SetOfflinePingResponse(), SLNet::RakPeer::Shutdown(), and SLNet::SignaledEvent::WaitOnEvent().

void SimpleMutex::Unlock | ( | void |  | ) |

Definition at line 154 of file SimpleMutex.cpp.

References RakAssert.

Referenced by SLNet::RakPeer::AddPacketToProducer(), SLNet::RakPeer::AddToBanList(), SLNet::RakPeer::AddToSecurityExceptionList(), SLNet::RakPeer::AllocPacket(), SLNet::RakPeer::AllocRNS2RecvStruct(), SLNet::RakPeer::CancelConnectionAttempt(), SLNet::RakPeer::ClearBanList(), SLNet::RakPeer::ClearBufferedPackets(), SLNet::RakPeer::ClearRequestedConnectionList(), SLNet::RakString::Clone(), SLNet::RakPeer::DeallocatePacket(), SLNet::RakPeer::DeallocRNS2RecvStruct(), for(), SLNet::RakString::Free(), SLNet::RakPeer::GetConnectionState(), SLNet::RakPeer::GetNextSendReceipt(), SLNet::RakPeer::GetOfflinePingResponse(), SLNet::RakPeer::GetReceiveBufferSize(), SLNet::RakPeer::IncrementNextSendReceipt(), SLNet::RakPeer::IsBanned(), SLNet::RakPeer::IsInSecurityExceptionList(), operator+(), SLNet::RakString::operator=(), SLNet::RakPeer::PopBufferedPacket(), SLNet::ProcessOfflineNetworkPacket(), SLNet::RakPeer::PushBackPacket(), SLNet::RakPeer::PushBufferedPacket(), SLNet::RakString::RakString(), SLNet::RakPeer::Receive(), SLNet::RakPeer::RemoveFromBanList(), SLNet::RakPeer::RemoveFromSecurityExceptionList(), SLNet::RemoteClient::Reset(), SLNet::RakPeer::ResetSendReceipt(), SLNet::RakPeer::RunUpdateCycle(), SLNet::RakPeer::Send(), SLNet::RakPeer::SendConnectionRequest(), SLNet::SignaledEvent::SetEvent(), SLNet::RakPeer::SetOfflinePingResponse(), SLNet::RakPeer::Shutdown(), SLNet::RakString::UnlockMutex(), and SLNet::SignaledEvent::WaitOnEvent().

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

- Source/include/slikenet/SimpleMutex.h
- Source/src/SimpleMutex.cpp