cross-platform define update

This commit is contained in:
2019-12-10 14:38:29 +08:00
parent 2d8da351ba
commit 1bfb503e13
6 changed files with 25 additions and 14 deletions

View File

@@ -12,7 +12,7 @@ namespace hgl
*/
class CondVar
{
void *cond_var;
conv_var_ptr *cond_var;
public:

View File

@@ -9,14 +9,14 @@ namespace hgl
*/
class RWLock ///读写锁/共享锁
{
void *lock;
rwlock_ptr *lock;
public:
RWLock();
virtual ~RWLock();
void *GetRWLock(){ return lock; } ///<返回操作系级锁
rwlock_ptr *GetRWLock(){ return lock; } ///<返回操作系级锁
bool TryReadLock(); ///<尝试读(共享访问)锁定
bool ReadLock(); ///<读(共享访问)锁定

View File

@@ -1,9 +1,7 @@
#ifndef HGL_SEMAPHORE_INCLUDE
#define HGL_SEMAPHORE_INCLUDE
#ifdef __APPLE__
#include<dispatch/dispatch.h>
#endif//__APPLE__
#include<hgl/platform/Platform.h>
namespace hgl
{
@@ -13,11 +11,7 @@ namespace hgl
*/
class Semaphore ///信号
{
#ifdef __APPLE__
dispatch_semaphore_t ptr;
#else
void *ptr;
#endif//__APPLE__
semaphore_ptr ptr;
public: