Changeset 630 for trunk/src


Ignore:
Timestamp:
Mar 4, 2010, 7:39:52 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

3rdparty/clucene: Added OS/2 support [patch by rudi].

Location:
trunk/src/3rdparty/clucene/src/CLucene
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/3rdparty/clucene/src/CLucene/LuceneThreads.h

    r2 r630  
    4545                #endif
    4646                #include "CLucene/config/threadCSection.h"
     47
     48
     49
     50
     51
    4752        #else
    4853                #error A valid thread library was not found
  • trunk/src/3rdparty/clucene/src/CLucene/config/compiler.h

    r2 r630  
    8080#define _WIN32
    8181#include "CLucene/config/PlatformWin32.h"
     82
     83
     84
     85
     86
    8287
    8388#elif defined (__WIN16) || defined (WIN16) || defined (_WIN16)
  • trunk/src/3rdparty/clucene/src/CLucene/config/threads.cpp

    r2 r630  
    4848          extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId();
    4949   #endif
    50        
     50
    5151        mutex_win32::mutex_win32(const mutex_win32& clone){
    52                 InitializeCriticalSection(&mtx); 
     52                InitializeCriticalSection(&mtx);
    5353        }
    5454        mutex_win32::mutex_win32()
    55         { 
    56                 InitializeCriticalSection(&mtx); 
     55        {
     56                InitializeCriticalSection(&mtx);
    5757        }
    58        
     58
    5959        mutex_win32::~mutex_win32()
    60         { 
    61                 DeleteCriticalSection(&mtx); 
     60        {
     61                DeleteCriticalSection(&mtx);
    6262        }
    63        
     63
    6464        void mutex_win32::lock()
    65         { 
    66                 EnterCriticalSection(&mtx); 
     65        {
     66                EnterCriticalSection(&mtx);
    6767        }
    68        
     68
    6969        void mutex_win32::unlock()
    70         { 
    71                 LeaveCriticalSection(&mtx); 
     70        {
     71                LeaveCriticalSection(&mtx);
    7272        }
    7373
     
    7676#elif defined(_CL_HAVE_PTHREAD)
    7777        #include "CLucene/config/threadPthread.h"
    78                
     78
    7979        #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE
    8080                bool mutex_pthread_attr_initd=false;
    8181                pthread_mutexattr_t mutex_pthread_attr;
    8282        #endif
    83        
     83
    8484        #ifdef _CL__CND_DEBUG
    8585                #define _CLPTHREAD_CHECK(c,m) CND_PRECONDITION(c==0,m)
     
    9292                _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, &mutex_pthread_attr), "mutex_pthread(clone) constructor failed")
    9393                #else
    94                 #if defined(__hpux) && defined(_DECTHREADS_)
     94                #if defined(__hpux) && defined(_DECTHREADS_)
    9595                        _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, pthread_mutexattr_default), "mutex_pthread(clone) constructor failed")
    9696                #else
     
    102102        }
    103103        mutex_pthread::mutex_pthread()
    104         { 
     104        {
    105105                #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE
    106                 if ( mutex_pthread_attr_initd == false ){
    107                         pthread_mutexattr_init(&mutex_pthread_attr);
    108                         pthread_mutexattr_settype(&mutex_pthread_attr, PTHREAD_MUTEX_RECURSIVE);
    109                         mutex_pthread_attr_initd = true;
     106                if ( mutex_pthread_attr_initd == false ){
     107                        pthread_mutexattr_init(&mutex_pthread_attr);
     108                        pthread_mutexattr_settype(&mutex_pthread_attr, PTHREAD_MUTEX_RECURSIVE);
     109                        mutex_pthread_attr_initd = true;
    110110                }
    111111                _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, &mutex_pthread_attr), "mutex_pthread(clone) constructor failed")
     
    141141                #endif
    142142        }
    143        
     143
    144144        void mutex_pthread::unlock()
    145         { 
     145        {
    146146                #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE
    147147                --lockCount;
     
    156156        }
    157157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
    158193#endif //thread impl choice
    159194
Note: See TracChangeset for help on using the changeset viewer.