/***************************************************************************
                Mutex lock class
                -----------------------------------------
    begin      : 2013/06/21
	copyright  : (C) 2005 Solbox Inc.
    author     : Dev 1 Team
    email      : dev1@solbox.com
    version    : 3.2.0

    CopyRight(C) 2005 Solbox Inc. All Rights reserved.
    Redistribution and use in source and binary forms, with or with out
    modification, are not permitted in outside of Solbox Inc.
*****************************************************************************/

// 

#ifndef __MUTEX_LOCK_CALSS__
#define __MUTEX_LOCK_CALSS__

#include <pthread.h>

class ProtectedMutex
{
	pthread_mutex_t &mutex;
public:
	ProtectedMutex(pthread_mutex_t &m)
		: mutex(m)
	{
		pthread_mutex_lock(&mutex);
	}
	~ProtectedMutex()
	{
		pthread_mutex_unlock(&mutex);
	}
};

#endif // __MUTEX_LOCK_CALSS__
