1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

WL#3230 concurrent hash

Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
This commit is contained in:
Marc Alff
2009-11-17 19:31:40 -07:00
parent 7b9fd341a0
commit 244eced1a7
11 changed files with 1713 additions and 4 deletions

View File

@@ -152,6 +152,7 @@ int pthread_join(pthread_t thread, void **value_ptr);
#define pthread_detach_this_thread()
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
#define pthread_yield() SwitchToThread()
#define my_pthread_getprio(thread_id) pthread_dummy(0)
@@ -385,6 +386,17 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
/* no pthread_yield() available */
#ifdef HAVE_SCHED_YIELD
#define pthread_yield() sched_yield()
#elif defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */
#define pthread_yield() pthread_yield_np()
#elif defined(HAVE_THR_YIELD)
#define pthread_yield() thr_yield()
#endif
#endif
/*
The defines set_timespec and set_timespec_nsec should be used
for calculating an absolute time at which
@@ -663,6 +675,7 @@ struct st_my_thread_var
my_bool init;
struct st_my_thread_var *next,**prev;
void *opt_info;
void *stack_ends_here;
#ifndef DBUG_OFF
void *dbug;
char name[THREAD_NAME_SIZE+1];