Commit b54ac072 authored by Sergei Golubchik's avatar Sergei Golubchik

fixes for windows

parent 8ccb262d
......@@ -98,7 +98,7 @@ struct timespec {
#define set_timespec_nsec(ABSTIME,NSEC) do { \
union ft64 tv; \
GetSystemTimeAsFileTime(&tv.ft); \
set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)) \
set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)); \
} while(0)
void win_pthread_init(void);
......
......@@ -80,7 +80,7 @@ typedef struct st_wt_resource {
in the sense that lf_hash_insert() won't memcpy() over them.
See wt_init().
*/
pthread_rwlock_t lock;
rw_lock_t lock;
pthread_cond_t cond;
DYNAMIC_ARRAY owners;
} WT_RESOURCE;
......
......@@ -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
lf_alloc-pin.c lf_dynarray.c lf_hash.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)
......
......@@ -170,19 +170,19 @@ static my_atomic_rwlock_t cycle_stats_lock, wait_stats_lock, success_stats_lock;
do { \
WT_RESOURCE *R=(X); \
DBUG_PRINT("wt", ("LOCK resid=%lld for READ", R->id.value.num)); \
pthread_rwlock_rdlock(&R->lock); \
rw_rdlock(&R->lock); \
} while (0)
#define rc_wrlock(X) \
do { \
WT_RESOURCE *R=(X); \
DBUG_PRINT("wt", ("LOCK resid=%lld for WRITE", R->id.value.num)); \
pthread_rwlock_wrlock(&R->lock); \
rw_wrlock(&R->lock); \
} while (0)
#define rc_unlock(X) \
do { \
WT_RESOURCE *R=(X); \
DBUG_PRINT("wt", ("UNLOCK resid=%lld", R->id.value.num)); \
pthread_rwlock_unlock(&R->lock); \
rw_unlock(&R->lock); \
} while (0)
/*
......@@ -203,7 +203,7 @@ static void wt_resource_init(uchar *arg)
DBUG_ENTER("wt_resource_init");
bzero(rc, sizeof(*rc));
pthread_rwlock_init(&rc->lock, 0);
my_rwlock_init(&rc->lock, 0);
pthread_cond_init(&rc->cond, 0);
my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5);
DBUG_VOID_RETURN;
......@@ -221,7 +221,7 @@ static void wt_resource_destroy(uchar *arg)
DBUG_ENTER("wt_resource_destroy");
DBUG_ASSERT(rc->owners.elements == 0);
pthread_rwlock_destroy(&rc->lock);
rwlock_destroy(&rc->lock);
pthread_cond_destroy(&rc->cond);
delete_dynamic(&rc->owners);
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