Added SYSDEPS_GetUnixTid to return the Unix thread id to send to the
server.
This commit is contained in:
parent
b2d39ea5f0
commit
6f7a204466
|
@ -13247,10 +13247,12 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in \
|
for ac_func in \
|
||||||
_lwp_create \
|
_lwp_create \
|
||||||
|
_lwp_self \
|
||||||
_pclose \
|
_pclose \
|
||||||
_popen \
|
_popen \
|
||||||
_snprintf \
|
_snprintf \
|
||||||
|
|
|
@ -943,6 +943,7 @@ dnl **** Check for functions ****
|
||||||
AC_FUNC_ALLOCA()
|
AC_FUNC_ALLOCA()
|
||||||
AC_CHECK_FUNCS(\
|
AC_CHECK_FUNCS(\
|
||||||
_lwp_create \
|
_lwp_create \
|
||||||
|
_lwp_self \
|
||||||
_pclose \
|
_pclose \
|
||||||
_popen \
|
_popen \
|
||||||
_snprintf \
|
_snprintf \
|
||||||
|
|
|
@ -677,6 +677,9 @@
|
||||||
/* Define to 1 if you have the `_lwp_create' function. */
|
/* Define to 1 if you have the `_lwp_create' function. */
|
||||||
#undef HAVE__LWP_CREATE
|
#undef HAVE__LWP_CREATE
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `_lwp_self' function. */
|
||||||
|
#undef HAVE__LWP_SELF
|
||||||
|
|
||||||
/* Define to 1 if you have the `_pclose' function. */
|
/* Define to 1 if you have the `_pclose' function. */
|
||||||
#undef HAVE__PCLOSE
|
#undef HAVE__PCLOSE
|
||||||
|
|
||||||
|
|
|
@ -147,6 +147,7 @@ extern TEB *THREAD_IdToTEB( DWORD id );
|
||||||
/* scheduler/sysdeps.c */
|
/* scheduler/sysdeps.c */
|
||||||
extern int SYSDEPS_SpawnThread( TEB *teb );
|
extern int SYSDEPS_SpawnThread( TEB *teb );
|
||||||
extern void SYSDEPS_SetCurThread( TEB *teb );
|
extern void SYSDEPS_SetCurThread( TEB *teb );
|
||||||
|
extern int SYSDEPS_GetUnixTid(void);
|
||||||
extern void SYSDEPS_InitErrno(void);
|
extern void SYSDEPS_InitErrno(void);
|
||||||
extern void DECLSPEC_NORETURN SYSDEPS_ExitThread( int status );
|
extern void DECLSPEC_NORETURN SYSDEPS_ExitThread( int status );
|
||||||
extern void DECLSPEC_NORETURN SYSDEPS_AbortThread( int status );
|
extern void DECLSPEC_NORETURN SYSDEPS_AbortThread( int status );
|
||||||
|
|
|
@ -694,7 +694,7 @@ void CLIENT_InitThread(void)
|
||||||
SERVER_START_REQ( init_thread )
|
SERVER_START_REQ( init_thread )
|
||||||
{
|
{
|
||||||
req->unix_pid = getpid();
|
req->unix_pid = getpid();
|
||||||
req->unix_tid = -1;
|
req->unix_tid = SYSDEPS_GetUnixTid();
|
||||||
req->teb = teb;
|
req->teb = teb;
|
||||||
req->entry = teb->entry_point;
|
req->entry = teb->entry_point;
|
||||||
req->reply_fd = reply_pipe[1];
|
req->reply_fd = reply_pipe[1];
|
||||||
|
|
|
@ -317,6 +317,25 @@ void SYSDEPS_AbortThread( int status )
|
||||||
_exit( status );
|
_exit( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* SYSDEPS_GetUnixTid
|
||||||
|
*
|
||||||
|
* Get the Unix tid of the current thread.
|
||||||
|
*/
|
||||||
|
int SYSDEPS_GetUnixTid(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE__LWP_SELF
|
||||||
|
return _lwp_self();
|
||||||
|
#elif defined(__linux__) && defined(__i386__)
|
||||||
|
int ret;
|
||||||
|
__asm__("int $0x80" : "=a" (ret) : "0" (224) /* SYS_gettid */);
|
||||||
|
if (ret < 0) ret = -1;
|
||||||
|
return ret;
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* default errno before threading is initialized */
|
/* default errno before threading is initialized */
|
||||||
static int *default_errno_location(void)
|
static int *default_errno_location(void)
|
||||||
|
|
Loading…
Reference in New Issue