Please observe it :) :
class CDataChest
{
CCriticalSection m_cCriticalSection;
int m_iCount;
bool m_bWritten;
CMap<HANDLE, HANDLE, bool, bool> m_RedersDoneFlags;
public:
CDataChest();
bool GetCount(HANDLE hReaderThread, int& iCount);
bool SetCount(int iCount);
void RemoveReader(HANDLE hExitingReaderThread);
};
When you will need more explanations - just request it :)