/* libzz
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
*/

#ifndef zz_win_threadmutex_h
#define zz_win_threadmutex_h 1

#include <windows.h>
#include <zz_threadmutex.h>
#include <zz_export.h>

/**
    Mutex for windows

    @author Toni Thomsson, toni@tonjac.org  
*/
class ZZ_API CzzWinThreadMutex : public CzzThreadMutex
{
  
public:
    
    /** Mutex */
    CzzWinThreadMutex();

    virtual ~CzzWinThreadMutex();

    /** Enter critical section, sets the lock */
    virtual bool Acquire( bool block );

    /** Leave critical section, unlock */
    virtual void Release();

protected:

    /** Semaphore */
    CRITICAL_SECTION m_Sem;
};

#endif