Commit 96fff96c authored by Sergei Golubchik's avatar Sergei Golubchik

fixes for windows

parent c9e78d14
...@@ -98,7 +98,7 @@ struct timespec { ...@@ -98,7 +98,7 @@ struct timespec {
#define set_timespec_nsec(ABSTIME,NSEC) do { \ #define set_timespec_nsec(ABSTIME,NSEC) do { \
union ft64 tv; \ union ft64 tv; \
GetSystemTimeAsFileTime(&tv.ft); \ GetSystemTimeAsFileTime(&tv.ft); \
set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)) \ set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)); \
} while(0) } while(0)
void win_pthread_init(void); void win_pthread_init(void);
......
...@@ -80,7 +80,7 @@ typedef struct st_wt_resource { ...@@ -80,7 +80,7 @@ typedef struct st_wt_resource {
in the sense that lf_hash_insert() won't memcpy() over them. in the sense that lf_hash_insert() won't memcpy() over them.
See wt_init(). See wt_init().
*/ */
pthread_rwlock_t lock; rw_lock_t lock;
pthread_cond_t cond; pthread_cond_t cond;
DYNAMIC_ARRAY owners; DYNAMIC_ARRAY owners;
} WT_RESOURCE; } WT_RESOURCE;
......
...@@ -44,7 +44,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_ ...@@ -44,7 +44,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_
thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c
lf_alloc-pin.c lf_dynarray.c lf_hash.c lf_alloc-pin.c lf_dynarray.c lf_hash.c
my_atomic.c my_getncpus.c my_rnd.c my_atomic.c my_getncpus.c my_rnd.c
my_uuid.c wqueue.c my_uuid.c wqueue.c waiting_threads.c
) )
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
......
...@@ -170,19 +170,19 @@ static my_atomic_rwlock_t cycle_stats_lock, wait_stats_lock, success_stats_lock; ...@@ -170,19 +170,19 @@ static my_atomic_rwlock_t cycle_stats_lock, wait_stats_lock, success_stats_lock;
do { \ do { \
WT_RESOURCE *R=(X); \ WT_RESOURCE *R=(X); \
DBUG_PRINT("wt", ("LOCK resid=%lld for READ", R->id.value.num)); \ DBUG_PRINT("wt", ("LOCK resid=%lld for READ", R->id.value.num)); \
pthread_rwlock_rdlock(&R->lock); \ rw_rdlock(&R->lock); \
} while (0) } while (0)
#define rc_wrlock(X) \ #define rc_wrlock(X) \
do { \ do { \
WT_RESOURCE *R=(X); \ WT_RESOURCE *R=(X); \
DBUG_PRINT("wt", ("LOCK resid=%lld for WRITE", R->id.value.num)); \ DBUG_PRINT("wt", ("LOCK resid=%lld for WRITE", R->id.value.num)); \
pthread_rwlock_wrlock(&R->lock); \ rw_wrlock(&R->lock); \
} while (0) } while (0)
#define rc_unlock(X) \ #define rc_unlock(X) \
do { \ do { \
WT_RESOURCE *R=(X); \ WT_RESOURCE *R=(X); \
DBUG_PRINT("wt", ("UNLOCK resid=%lld", R->id.value.num)); \ DBUG_PRINT("wt", ("UNLOCK resid=%lld", R->id.value.num)); \
pthread_rwlock_unlock(&R->lock); \ rw_unlock(&R->lock); \
} while (0) } while (0)
/* /*
...@@ -203,7 +203,7 @@ static void wt_resource_init(uchar *arg) ...@@ -203,7 +203,7 @@ static void wt_resource_init(uchar *arg)
DBUG_ENTER("wt_resource_init"); DBUG_ENTER("wt_resource_init");
bzero(rc, sizeof(*rc)); bzero(rc, sizeof(*rc));
pthread_rwlock_init(&rc->lock, 0); my_rwlock_init(&rc->lock, 0);
pthread_cond_init(&rc->cond, 0); pthread_cond_init(&rc->cond, 0);
my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5); my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
...@@ -221,7 +221,7 @@ static void wt_resource_destroy(uchar *arg) ...@@ -221,7 +221,7 @@ static void wt_resource_destroy(uchar *arg)
DBUG_ENTER("wt_resource_destroy"); DBUG_ENTER("wt_resource_destroy");
DBUG_ASSERT(rc->owners.elements == 0); DBUG_ASSERT(rc->owners.elements == 0);
pthread_rwlock_destroy(&rc->lock); rwlock_destroy(&rc->lock);
pthread_cond_destroy(&rc->cond); pthread_cond_destroy(&rc->cond);
delete_dynamic(&rc->owners); delete_dynamic(&rc->owners);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment