Software: Apache. PHP/5.5.15 uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 SYSTEM Safe-mode: OFF (not secure) E:\nuevo\mysql\include\ drwxrwxrwx |
Viewing file: Select action/file-type: /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* Defines to make different thread packages compatible */ #ifndef _my_pthread_h #define _my_pthread_h #include "my_global.h" /* myf */ #ifndef ETIME #define ETIME ETIMEDOUT /* For FreeBSD */ #endif #ifdef __cplusplus #define EXTERNC extern "C" extern "C" { #else #define EXTERNC #endif /* __cplusplus */ #if defined(__WIN__) typedef CRITICAL_SECTION pthread_mutex_t; typedef DWORD pthread_t; typedef struct thread_attr { DWORD dwStackSize ; DWORD dwCreatingFlag ; } pthread_attr_t ; typedef struct { int dummy; } pthread_condattr_t; /* Implementation of posix conditions */ typedef struct st_pthread_link { DWORD thread_id; struct st_pthread_link *next; } pthread_link; /** Implementation of Windows condition variables. We use native conditions on Vista and later, and fallback to own implementation on earlier OS version. */ typedef union { /* Native condition (used on Vista and later) */ CONDITION_VARIABLE native_cond; /* Own implementation (used on XP) */ struct { uint32 waiting; CRITICAL_SECTION lock_waiting; enum { SIGNAL= 0, BROADCAST= 1, MAX_EVENTS= 2 } EVENTS; HANDLE events[MAX_EVENTS]; HANDLE broadcast_block_event; }; } pthread_cond_t; typedef int pthread_mutexattr_t; #define pthread_self() GetCurrentThreadId() #define pthread_handler_t EXTERNC void * __cdecl typedef void * (__cdecl *pthread_handler)(void *); typedef volatile LONG my_pthread_once_t; #define MY_PTHREAD_ONCE_INIT 0 #define MY_PTHREAD_ONCE_INPROGRESS 1 #define MY_PTHREAD_ONCE_DONE 2 /* Struct and macros to be used in combination with the windows implementation of pthread_cond_timedwait */ /* Declare a union to make sure FILETIME is properly aligned so it can be used directly as a 64 bit value. The value stored is in 100ns units. */ union ft64 { FILETIME ft; __int64 i64; }; struct timespec { union ft64 tv; /* The max timeout value in millisecond for pthread_cond_timedwait */ long max_timeout_msec; }; #define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \ (ABSTIME).tv.i64= (TIME)+(__int64)(NSEC)/100; \ (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ } while(0) #define set_timespec_nsec(ABSTIME,NSEC) do { \ union ft64 tv; \ GetSystemTimeAsFileTime(&tv.ft); \ set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)); \ } while(0) /** Compare two timespec structs. @retval 1 If TS1 ends after TS2. @retval 0 If TS1 is equal to TS2. @retval -1 If TS1 ends before TS2. */ #define cmp_timespec(TS1, TS2) \ ((TS1.tv.i64 > TS2.tv.i64) ? 1 : \ ((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0)) #define diff_timespec(TS1, TS2) \ ((TS1.tv.i64 - TS2.tv.i64) * 100) int win_pthread_mutex_trylock(pthread_mutex_t *mutex); int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *); int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime); int pthread_cond_signal(pthread_cond_t *cond); int pthread_cond_broadcast(pthread_cond_t *cond); int pthread_cond_destroy(pthread_cond_t *cond); int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); int pthread_attr_destroy(pthread_attr_t *connect_att); int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void)); struct tm *localtime_r(const time_t *timep,struct tm *tmp); struct tm *gmtime_r(const time_t *timep,struct tm *tmp); void pthread_exit(void *a); int pthread_join(pthread_t thread, void **value_ptr); int pthread_cancel(pthread_t thread); #ifndef ETIMEDOUT #define ETIMEDOUT 145 /* Win32 doesn't have this */ #endif #define HAVE_LOCALTIME_R 1 #define _REENTRANT 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #undef SAFE_MUTEX /* This will cause conflicts */ #define pthread_key(T,V) DWORD V #define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF) #define pthread_key_delete(A) TlsFree(A) #define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V))) #define pthread_setspecific(A,B) (!TlsSetValue((A),(B))) #define pthread_getspecific(A) (TlsGetValue(A)) #define my_pthread_getspecific(T,A) ((T) TlsGetValue(A)) #define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V)) #define pthread_equal(A,B) ((A) == (B)) #define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A)) #define pthread_mutex_unlock(A) (LeaveCriticalSection(A), 0) #define pthread_mutex_destroy(A) (DeleteCriticalSection(A), 0) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) /* Dummy defines for easier code */ #define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_attr_setscope(A,B) #define pthread_detach_this_thread() #define pthread_condattr_init(A) #define pthread_condattr_destroy(A) #define pthread_yield() SwitchToThread() #define my_sigset(A,B) signal(A,B) #else /* Normal threads */ #ifdef HAVE_rts_threads #define sigwait org_sigwait #include |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0156 ]-- |