Commit 0f60474f authored by unknown's avatar unknown
Browse files

pthread_handler_decl() changed to be ctags-friendly

(and contain extern "C" when necessary)

parent 970150d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_lock(A)    (EnterCriticalSection(A),0)
#define pthread_mutex_unlock(A)  LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define pthread_handler_decl(A,B) unsigned __cdecl A(void *B)
#define pthread_handler_t unsigned __cdecl *
typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_self() GetCurrentThread()

@@ -155,7 +155,7 @@ int _my_errno(void)
** The test program
*****************************************************************************/

pthread_handler_decl(test_thread,arg)
pthread_handler_t test_thread(void *arg)
{
  MYSQL mysql;
  MYSQL_RES *res;
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_lock(A)    (EnterCriticalSection(A),0)
#define pthread_mutex_unlock(A)  LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define pthread_handler_decl(A,B) unsigned __cdecl A(void *B)
#define pthread_handler_t unsigned __cdecl *
typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_self() GetCurrentThread()

@@ -174,7 +174,7 @@ int _my_errno(void)
** The test program
*****************************************************************************/

pthread_handler_decl(test_thread,arg)
pthread_handler_t test_thread(void *arg)
{
  pthread_mutex_lock(&LOCK_thread_count);
  thread_count--;
+7 −4
Original line number Diff line number Diff line
@@ -25,7 +25,10 @@
#endif

#ifdef  __cplusplus
#define EXTERN_C extern "C"
extern "C" {
#else
#define EXTERN_C
#endif /* __cplusplus */ 

#if defined(__WIN__) || defined(OS2)
@@ -77,10 +80,10 @@ struct timespec { /* For pthread_cond_timedwait() */
typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self
#ifdef OS2
#define pthread_handler_decl(A,B) void * _Optlink A(void *B)
#define pthread_handler_t EXTERN_C void * _Optlink
typedef void * (_Optlink *pthread_handler)(void *);
#else
#define pthread_handler_decl(A,B) void * __cdecl A(void *B)
#define pthread_handler_t EXTERN_C void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
#endif

@@ -184,7 +187,7 @@ typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A)

#define pthread_handler_decl(A,B) void *A(void *B)
#define pthread_handler_t EXTERN_C void *
#define pthread_key(T,V) pthread_key_t V

void *	my_pthread_getspecific_imp(pthread_key_t key);
@@ -262,7 +265,7 @@ extern int my_pthread_getprio(pthread_t thread_id);
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread()
#define pthread_handler_decl(A,B) void *A(void *B)
#define pthread_handler_t EXTERN_C void *
typedef void *(* pthread_handler)(void *);

/* Test first for RTS or FSU threads */
+1 −1
Original line number Diff line number Diff line
@@ -728,7 +728,7 @@ int flush_pending_blocks(MI_SORT_PARAM *param);
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param);
#ifdef THREAD
pthread_handler_decl(thr_find_all_keys,arg);
pthread_handler_t thr_find_all_keys(void *arg);
#endif
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file);

+1 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
#ifdef THREAD
/* Search after all keys and place them in a temp. file */

pthread_handler_decl(thr_find_all_keys,arg)
pthread_handler_t thr_find_all_keys(void *arg)
{
  MI_SORT_PARAM *info= (MI_SORT_PARAM*) arg;
  int error;
Loading