get_threadid should return long

ulab-original
jsorg71 19 years ago
parent 4e93fc3c37
commit e91c34f803

@ -25,10 +25,11 @@
#else #else
#include <pthread.h> #include <pthread.h>
#endif #endif
#include "arch.h"
/*****************************************************************************/ /*****************************************************************************/
#if defined(_WIN32) #if defined(_WIN32)
int int APP_CC
g_thread_create(unsigned long (__stdcall * start_routine)(void*), void* arg) g_thread_create(unsigned long (__stdcall * start_routine)(void*), void* arg)
{ {
DWORD thread; DWORD thread;
@ -36,7 +37,7 @@ g_thread_create(unsigned long (__stdcall * start_routine)(void*), void* arg)
return !CreateThread(0, 0, start_routine, arg, 0, &thread); return !CreateThread(0, 0, start_routine, arg, 0, &thread);
} }
#else #else
int int APP_CC
g_thread_create(void* (* start_routine)(void*), void* arg) g_thread_create(void* (* start_routine)(void*), void* arg)
{ {
pthread_t thread; pthread_t thread;
@ -49,12 +50,12 @@ g_thread_create(void* (* start_routine)(void*), void* arg)
#endif #endif
/*****************************************************************************/ /*****************************************************************************/
int long APP_CC
g_get_threadid(void) g_get_threadid(void)
{ {
#if defined(_WIN32) #if defined(_WIN32)
return 0; return 0;
#else #else
return pthread_self(); return (long)pthread_self();
#endif #endif
} }

@ -21,9 +21,9 @@
#if !defined(THREAD_CALLS_H) #if !defined(THREAD_CALLS_H)
#define THREAD_CALLS_H #define THREAD_CALLS_H
int int APP_CC
g_thread_create(THREAD_RV (THREAD_CC * start_routine)(void*), void* arg); g_thread_create(THREAD_RV (THREAD_CC * start_routine)(void*), void* arg);
int long APP_CC
g_get_threadid(void); g_get_threadid(void);
#endif #endif

@ -28,7 +28,7 @@
#include "xrdp.h" #include "xrdp.h"
static struct xrdp_listen* g_listen = 0; static struct xrdp_listen* g_listen = 0;
static int g_threadid = 0; /* main threadid */ static long g_threadid = 0; /* main threadid */
#if defined(_WIN32) #if defined(_WIN32)
static SERVICE_STATUS_HANDLE g_ssh = 0; static SERVICE_STATUS_HANDLE g_ssh = 0;

Loading…
Cancel
Save