2009-08-01 20:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbsetup.h
  * harbour/include/hbthread.h
  * harbour/include/hbatomic.h
  * harbour/source/vm/thread.c
    * added support for MT mode in WinCE builds using raw MS-Windows API
      instead of CRTL wrappers. It's possible that it may badly interact
      with some CRTLs functions we are using in our code so I do not know
      it will work. Please test.
This commit is contained in:
Przemyslaw Czerpak
2009-08-01 18:24:40 +00:00
parent 242cc75975
commit 83b409179a
5 changed files with 32 additions and 10 deletions

View File

@@ -17,6 +17,16 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-08-01 20:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbsetup.h
* harbour/include/hbthread.h
* harbour/include/hbatomic.h
* harbour/source/vm/thread.c
* added support for MT mode in WinCE builds using raw MS-Windows API
instead of CRTL wrappers. It's possible that it may badly interact
with some CRTLs functions we are using in our code so I do not know
it will work. Please test.
2009-08-01 19:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/global.cf
* Changed HB_BUILD_SUBDIR to HB_BUILD_NAME.

View File

@@ -178,7 +178,8 @@ HB_EXTERN_BEGIN
# define HB_SPINLOCK_ACQUIRE(l) hb_spinlock_acquire(l)
# define HB_SPINLOCK_RELEASE(l) hb_spinlock_release(l)
# elif ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 1) )
# elif ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 1) ) && \
!defined( __MINGW32CE__ )
# define HB_ATOM_INC( p ) __sync_add_and_fetch( (p), 1 )
# define HB_ATOM_DEC( p ) __sync_sub_and_fetch( (p), 1 )

View File

@@ -472,10 +472,6 @@
#define HB_OS_EOL_LEN 2
#endif
#if defined( HB_OS_WIN_CE ) && defined( HB_MT_VM )
#undef HB_MT_VM
#endif
/* ***********************************************************************
* See also the following files for task specific definitions/settings
*

View File

@@ -173,14 +173,25 @@ HB_EXTERN_BEGIN
#elif defined( HB_OS_WIN )
typedef HB_LONG HB_THREAD_NO;
typedef unsigned HB_THREAD_ID;
typedef HANDLE HB_THREAD_HANDLE;
typedef CRITICAL_SECTION HB_RAWCRITICAL_T;
typedef HANDLE HB_OSCOND_T;
# define HB_THREAD_STARTFUNC( func ) unsigned __stdcall func( void * Cargo )
# define HB_THREAD_END _endthreadex( 0 ); return 0;
# define HB_THREAD_RAWEND return 0;
# if defined( HB_OS_WIN_CE ) && \
( defined( __MINGW32CE__ ) && !defined( __MSVCRT__ ) )
# define HB_THREAD_RAWWINAPI
# endif
# if defined( HB_THREAD_RAWWINAPI )
typedef DWORD HB_THREAD_ID;
# define HB_THREAD_STARTFUNC( func ) DWORD WINAPI func( void * Cargo )
# define HB_THREAD_END ExitThread( 0 ); return 0;
# else
typedef unsigned HB_THREAD_ID;
# define HB_THREAD_STARTFUNC( func ) unsigned __stdcall func( void * Cargo )
# define HB_THREAD_END _endthreadex( 0 ); return 0;
# endif
# define HB_THREAD_RAWEND return 0;
# define HB_THREAD_SELF() GetCurrentThreadId()
# define HB_CRITICAL_INITVAL { 0, 0, 0, 0, 0, 0 }

View File

@@ -774,7 +774,11 @@ HB_THREAD_HANDLE hb_threadCreate( HB_THREAD_ID * th_id, PHB_THREAD_STARTFUNC sta
*th_id = ( HB_THREAD_ID ) 0;
th_h = *th_id;
#elif defined( HB_OS_WIN )
th_h = ( HANDLE ) _beginthreadex( NULL, 0, start_func, Cargo, 0, th_id );
# if defined( HB_THREAD_RAWWINAPI )
th_h = CreateThread( NULL, 0, start_func, Cargo, 0, th_id );
# else
th_h = ( HANDLE ) _beginthreadex( NULL, 0, start_func, Cargo, 0, th_id );
# endif
if( !th_h )
*th_id = ( HB_THREAD_ID ) 0;
#elif defined( HB_OS_OS2 )