summaryrefslogtreecommitdiff
path: root/storage/pbxt
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-10-21 23:07:13 +0200
committerSergei Golubchik <sergii@pisem.net>2011-10-21 23:07:13 +0200
commitaeaa112edbf40f17c7978642539443544241185d (patch)
tree97faebc5269e23af60a451907271bfa11643f353 /storage/pbxt
parentb3223453f7e4398ff0f55471ac7dc4aecf2caf8d (diff)
downloadmariadb-git-aeaa112edbf40f17c7978642539443544241185d.tar.gz
fixes for windows
Diffstat (limited to 'storage/pbxt')
-rw-r--r--storage/pbxt/CMakeLists.txt3
-rw-r--r--storage/pbxt/src/datalog_xt.cc2
-rwxr-xr-xstorage/pbxt/src/pthread_xt.cc32
-rw-r--r--storage/pbxt/src/thread_xt.cc9
4 files changed, 3 insertions, 43 deletions
diff --git a/storage/pbxt/CMakeLists.txt b/storage/pbxt/CMakeLists.txt
index b87c0810c29..6ddb679bc36 100644
--- a/storage/pbxt/CMakeLists.txt
+++ b/storage/pbxt/CMakeLists.txt
@@ -90,6 +90,5 @@ src/xt_config.h
src/xt_defs.h
src/xt_errno.h)
-SET(PBXT_PLUGIN_STATIC "pbxt")
-MYSQL_ADD_PLUGIN(pbxt ${PBXT_SOURCES} STORAGE_ENGINE)
+MYSQL_ADD_PLUGIN(pbxt ${PBXT_SOURCES} STORAGE_ENGINE STATIC_ONLY)
diff --git a/storage/pbxt/src/datalog_xt.cc b/storage/pbxt/src/datalog_xt.cc
index 449eaa9450c..aa54182b893 100644
--- a/storage/pbxt/src/datalog_xt.cc
+++ b/storage/pbxt/src/datalog_xt.cc
@@ -26,8 +26,8 @@
#include <stdio.h>
#ifndef XT_WIN
#include <unistd.h>
-#include <signal.h>
#endif
+#include <signal.h>
#include <stdlib.h>
#ifndef DRIZZLED
diff --git a/storage/pbxt/src/pthread_xt.cc b/storage/pbxt/src/pthread_xt.cc
index d704e977c21..aad87fca5f8 100755
--- a/storage/pbxt/src/pthread_xt.cc
+++ b/storage/pbxt/src/pthread_xt.cc
@@ -45,22 +45,16 @@ xtPublic void xt_p_init_threading(void)
xtPublic int xt_p_set_normal_priority(pthread_t thr)
{
- if (!SetThreadPriority (thr, THREAD_PRIORITY_NORMAL))
- return GetLastError();
return 0;
}
xtPublic int xt_p_set_low_priority(pthread_t thr)
{
- if (!SetThreadPriority (thr, THREAD_PRIORITY_LOWEST))
- return GetLastError();
return 0;
}
xtPublic int xt_p_set_high_priority(pthread_t thr)
{
- if (!SetThreadPriority (thr, THREAD_PRIORITY_HIGHEST))
- return GetLastError();
return 0;
}
@@ -401,31 +395,7 @@ xtPublic int xt_p_cond_timedwait(xt_cond_type *cond, xt_mutex_type *mt, struct t
xtPublic int xt_p_join(pthread_t thread, void **value)
{
- DWORD exitcode;
-
- while(1) {
- switch (WaitForSingleObject(thread, 10000)) {
- case WAIT_OBJECT_0:
- return 0;
- case WAIT_TIMEOUT:
- /* Don't do this! According to the Win docs:
- * _endthread automatically closes the thread handle
- * (whereas _endthreadex does not). Therefore, when using
- * _beginthread and _endthread, do not explicitly close the
- * thread handle by calling the Win32 CloseHandle API.
- CloseHandle(thread);
- */
- /* This is done so that if the thread was not [yet] in the running
- * state when this function was called we won't deadlock here.
- */
- if (GetExitCodeThread(thread, &exitcode) && (exitcode == STILL_ACTIVE))
- break;
- return 0;
- case WAIT_FAILED:
- return GetLastError();
- }
- }
-
+ pthread_join(thread, value);
return 0;
}
diff --git a/storage/pbxt/src/thread_xt.cc b/storage/pbxt/src/thread_xt.cc
index eb9941f13fb..1addf487153 100644
--- a/storage/pbxt/src/thread_xt.cc
+++ b/storage/pbxt/src/thread_xt.cc
@@ -1513,16 +1513,7 @@ xtPublic pthread_t xt_run_thread(XTThreadPtr self, XTThreadPtr child, void *(*st
data.td_started = FALSE;
data.td_thr = child;
data.td_start_routine = start_routine;
-#ifdef XT_WIN
- {
- pthread_attr_t attr = { 0, 0, 0 };
-
- attr.priority = THREAD_PRIORITY_NORMAL;
- err = pthread_create(&child_thread, &attr, xt_thread_main, &data);
- }
-#else
err = pthread_create(&child_thread, NULL, xt_thread_main, &data);
-#endif
if (err) {
xt_free_thread(child);
xt_throw_errno(XT_CONTEXT, err);