2008-11-03 14:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbthread.h
  * harbour/source/vm/thread.c
    + added ULONG _hb_gettid( void ) to OS2 builds - thanks to Maurilio

  * harbour/source/rtl/hbinet.c
    * changed a little bit the order of including header files in OS2 builds
      (blink fix for OpenWatcom OS2 builds).
This commit is contained in:
Przemyslaw Czerpak
2008-11-03 13:08:04 +00:00
parent 2862e26a68
commit 3fba5f0231
4 changed files with 40 additions and 12 deletions

View File

@@ -8,6 +8,15 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-11-03 14:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbthread.h
* harbour/source/vm/thread.c
+ added ULONG _hb_gettid( void ) to OS2 builds - thanks to Maurilio
* harbour/source/rtl/hbinet.c
* changed a little bit the order of including header files in OS2 builds
(blink fix for OpenWatcom OS2 builds).
2008-11-03 12:13 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
! Synced codepage list with recent changes.

View File

@@ -167,13 +167,19 @@ HB_EXTERN_BEGIN
typedef HMTX HB_RAWCRITICAL_T;
typedef HEV HB_RAWCOND_T;
extern ULONG _hb_gettid( void );
# define HB_THREAD_STARTFUNC( func ) void func( void * Cargo )
# define HB_THREAD_END _endthread(); return;
# define HB_THREAD_RAWEND return;
# define HB_CRITICAL_INITVAL ( ( HMTX ) 0 )
# define HB_COND_INITVAL ( ( HEV ) 0 )
# define HB_THREAD_SELF() ( ( TID ) _gettid() )
# if defined( __GNUC__ )
# define HB_THREAD_SELF() ( ( TID ) _gettid() )
# else
# define HB_THREAD_SELF() ( ( TID ) _hb_gettid() )
# endif
# define HB_CRITICAL_INIT(v) DosCreateMutexSem( NULL, &(v), 0L, FALSE )
# define HB_CRITICAL_DESTROY(v) DosCloseMutexSem( v )

View File

@@ -96,8 +96,18 @@
#define HB_SOCKET_T int
#include <unistd.h>
#if defined( HB_OS_OS2 )
#if defined( __WATCOMC__ )
#include <types.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/ioctl.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#endif
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -206,15 +216,10 @@
#include <errno.h>
#endif
#if defined( HB_OS_UNIX ) || defined( HB_OS_UNIX_COMPATIBLE ) || defined( HB_OS_BSD ) || defined( HB_OS_OS2 )
#if defined( HB_OS_UNIX ) || defined( HB_OS_UNIX_COMPATIBLE ) || defined( HB_OS_OS2 )
#include <sys/time.h>
#endif
#if defined( HB_OS_OS2 )
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/ioctl.h>
#endif
#if defined( HB_OS_OS2 ) || defined( HB_OS_WIN_32 )
/* NET_SIZE_T exists because of shortsightedness on the POSIX committee. BSD

View File

@@ -74,11 +74,6 @@
# include <sys/time.h>
#endif
/* temporary workaround for non GCC ST builds */
#if !defined( HB_MT_VM ) && defined( HB_OS_OS2 ) && !defined( __GNUC__ )
# define _gettid() 0
#endif
static volatile BOOL s_fThreadInit = FALSE;
static PHB_ITEM s_pOnceMutex = NULL;
@@ -188,6 +183,19 @@ void hb_threadExit( void )
}
}
#if defined( HB_OS_OS2 )
ULONG _hb_gettid( void )
{
ULONG tid = 0;
PTIB ptib = NULL;
if( DosGetInfoBlocks( &ptib, NULL ) == NO_ERROR )
tid = ptib->tib_ptib2->tib2_ultid;
return tid;
}
#endif
void hb_threadEnterCriticalSection( HB_CRITICAL_T * critical )
{
#if !defined( HB_MT_VM )