Browse Subversion Repository
Contents of /common/LockGuard.h
Parent Directory
| Revision Log
Revision 237 -
( show annotations)
( download)
( as text)
Mon Feb 11 21:51:26 2008 UTC
(16 years, 3 months ago)
by satofumi
File MIME type: text/x-chdr
File size: 822 byte(s)
debugging gui and gl_gui
| 1 |
#ifndef LOCK_GUARD_H |
| 2 |
#define LOCK_GUARD_H |
| 3 |
|
| 4 |
/*! |
| 5 |
\file |
| 6 |
\brief SDL_mutex のロックガードクラス |
| 7 |
|
| 8 |
\author Satofumi KAMIMURA |
| 9 |
|
| 10 |
$Id$ |
| 11 |
|
| 12 |
\todo SDL_mutex もラップすべきかを検討する。つか、typedef するだけか? むぅ |
| 13 |
*/ |
| 14 |
|
| 15 |
#ifdef MSC |
| 16 |
#include "SDL_win.h" |
| 17 |
#else |
| 18 |
#include <SDL.h> |
| 19 |
#endif |
| 20 |
#include <memory> |
| 21 |
|
| 22 |
|
| 23 |
namespace beego { |
| 24 |
/*! |
| 25 |
\brief SDL_mutex のロックガードクラス |
| 26 |
*/ |
| 27 |
class LockGuard { |
| 28 |
LockGuard(void); |
| 29 |
LockGuard(const LockGuard& rhs); |
| 30 |
LockGuard& operator = (const LockGuard& rhs); |
| 31 |
|
| 32 |
void* operator new (size_t); |
| 33 |
void* operator new[] (size_t); |
| 34 |
|
| 35 |
struct pImpl; |
| 36 |
const std::auto_ptr<pImpl> pimpl; |
| 37 |
|
| 38 |
public: |
| 39 |
explicit LockGuard(SDL_mutex* mutex); |
| 40 |
~LockGuard(void); |
| 41 |
}; |
| 42 |
|
| 43 |
extern void LockMutex(SDL_mutex* mutex); |
| 44 |
extern void UnlockMutex(SDL_mutex* mutex); |
| 45 |
}; |
| 46 |
|
| 47 |
#endif /* !LOCK_GUARD_H */ |
|