fix thread macro in Linux
This commit is contained in:
parent
e90f8c9479
commit
25748fde9b
@ -7,7 +7,7 @@ using u32char =char32_t;
|
||||
using u16char =char16_t;
|
||||
using os_char =char;
|
||||
#define to_oschar to_u8
|
||||
#define OS_TEXT(str) u8##str
|
||||
#define OS_TEXT(str) str
|
||||
#define U8_TEXT(str) u8##str
|
||||
#define U16_TEXT(str) u##str
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define HGL_POSIX_THREAD_INCLUDE
|
||||
|
||||
#include<pthread.h>
|
||||
#include<semaphore.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include<dispatch/dispatch.h>
|
||||
@ -12,19 +13,19 @@ namespace hgl
|
||||
using thread_mutex_ptr =pthread_mutex_t;
|
||||
|
||||
using thread_ptr =pthread_t;
|
||||
using rwlock_ptr =pthread_rwlock_t *;
|
||||
using rwlock_ptr =pthread_rwlock_t;
|
||||
|
||||
#ifdef __APPLE__
|
||||
using semaphore_ptr =dispatch_semaphore_t *;
|
||||
#else
|
||||
using semaphore_ptr =sem_t *;
|
||||
using semaphore_ptr =sem_t;
|
||||
#endif//
|
||||
|
||||
using cond_var_ptr =pthread_cond_t *;
|
||||
using cond_var_ptr =pthread_cond_t;
|
||||
|
||||
#define THREAD_FUNC void *
|
||||
#define HGL_THREAD_DETACH_SELF pthread_detach(pthread_self());
|
||||
|
||||
using proc_mutex_ptr =sem_t *;
|
||||
using proc_mutex_ptr =sem_t;
|
||||
}//namespace hgl
|
||||
#endif//HGL_POSIX_THREAD_INCLUDE
|
||||
|
@ -10,7 +10,7 @@ namespace hgl
|
||||
*/
|
||||
class ProcMutex ///进程排斥
|
||||
{
|
||||
proc_mutex_ptr lock;
|
||||
proc_mutex_ptr *lock;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace hgl
|
||||
*/
|
||||
class CondVar
|
||||
{
|
||||
conv_var_ptr *cond_var;
|
||||
cond_var_ptr *cond_var;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace hgl
|
||||
*/
|
||||
class Semaphore ///信号
|
||||
{
|
||||
semaphore_ptr ptr;
|
||||
semaphore_ptr *ptr;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace hgl
|
||||
|
||||
if(pi)return pi;
|
||||
|
||||
if(!FileExist(filename))return(false);
|
||||
if(!FileExist(filename))return(nullptr);
|
||||
|
||||
ExternalPlugIn *epi=new ExternalPlugIn;
|
||||
|
||||
@ -76,12 +76,7 @@ namespace hgl
|
||||
|
||||
if(fp_count<=0)return(nullptr);
|
||||
|
||||
#if HGL_OS == HGL_OS_Windows
|
||||
OSString pi_filename=name+L'.'+pi_name+HGL_PLUGIN_EXTNAME;
|
||||
#else
|
||||
OSString pi_filename=ToOSString(name)+'.'+ToOString(pi_name)+HGL_PLUGIN_EXTNAME;
|
||||
#endif//HGL_OS == HGL_OS_Windows
|
||||
|
||||
OSString pi_filename=name+OS_TEXT('.')+pi_name+HGL_PLUGIN_EXTNAME;
|
||||
OSString pi_fullfilename;
|
||||
ExternalPlugIn *epi=new ExternalPlugIn;
|
||||
|
||||
@ -106,7 +101,7 @@ namespace hgl
|
||||
|
||||
bool PlugInManage::UnloadPlugin(const OSString &pi_name)
|
||||
{
|
||||
if(pi_name.IsEmpty())return(nullptr);
|
||||
if(pi_name.IsEmpty())return(false);
|
||||
|
||||
this->Release(pi_name);
|
||||
return(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user