Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9c848813
Commit
9c848813
authored
Mar 22, 2006
by
knielsen@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define USE_TLS when compiling libmysql.dll, to avoid crashing when
loaded at runtime.
parent
bdc3f485
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
7 deletions
+23
-7
extra/comp_err.c
extra/comp_err.c
+2
-1
include/my_dbug.h
include/my_dbug.h
+1
-0
include/my_pthread.h
include/my_pthread.h
+7
-0
libmysql/cmakelists.txt
libmysql/cmakelists.txt
+4
-2
mysys/cmakelists.txt
mysys/cmakelists.txt
+5
-2
mysys/my_init.c
mysys/my_init.c
+4
-2
No files found.
extra/comp_err.c
View file @
9c848813
...
@@ -188,8 +188,9 @@ int main(int argc, char *argv[])
...
@@ -188,8 +188,9 @@ int main(int argc, char *argv[])
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
clean_up
(
lang_head
,
error_head
);
clean_up
(
lang_head
,
error_head
);
DBUG_LEAVE
;
/* Can't use dbug after my_end() */
my_end
(
info_flag
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
my_end
(
info_flag
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
DBUG_RETURN
(
0
)
;
return
0
;
}
}
}
}
...
...
include/my_dbug.h
View file @
9c848813
...
@@ -81,6 +81,7 @@ extern FILE *_db_fp_(void);
...
@@ -81,6 +81,7 @@ extern FILE *_db_fp_(void);
#else
/* No debugger */
#else
/* No debugger */
#define DBUG_ENTER(a1)
#define DBUG_ENTER(a1)
#define DBUG_LEAVE
#define DBUG_RETURN(a1) do { return(a1); } while(0)
#define DBUG_RETURN(a1) do { return(a1); } while(0)
#define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
...
...
include/my_pthread.h
View file @
9c848813
...
@@ -116,6 +116,13 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
...
@@ -116,6 +116,13 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define _REENTRANT 1
#define _REENTRANT 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
/*
Windows has two ways to use thread local storage. The most efficient
is using __declspec(thread), but that does not work properly when
used in a .dll that is loaded at runtime, after program load. So for
libmysql.dll and libmysqld.dll we define USE_TLS in order to use the
TlsXxx() API instead, which works in all cases.
*/
#ifdef USE_TLS
/* For LIBMYSQL.DLL */
#ifdef USE_TLS
/* For LIBMYSQL.DLL */
#undef SAFE_MUTEX
/* This will cause conflicts */
#undef SAFE_MUTEX
/* This will cause conflicts */
#define pthread_key(T,V) DWORD V
#define pthread_key(T,V) DWORD V
...
...
libmysql/cmakelists.txt
View file @
9c848813
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX"
)
# Need to set USE_TLS, since __declspec(thread) approach to thread local
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX"
)
# storage does not work properly in DLLs.
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS"
)
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/include
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/include
${
CMAKE_SOURCE_DIR
}
/zlib
${
CMAKE_SOURCE_DIR
}
/zlib
...
...
mysys/cmakelists.txt
View file @
9c848813
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR"
)
# Need to set USE_TLS, since mysys is linked into libmysql.dll and
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR"
)
# libmysqld.dll, and __declspec(thread) approach to thread local storage does
# not work properly in DLLs.
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR -DUSE_TLS"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR -DUSE_TLS"
)
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/zlib
${
CMAKE_SOURCE_DIR
}
/include
)
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/zlib
${
CMAKE_SOURCE_DIR
}
/include
)
ADD_LIBRARY
(
mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c
ADD_LIBRARY
(
mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c
...
...
mysys/my_init.c
View file @
9c848813
...
@@ -134,7 +134,10 @@ void my_end(int infoflag)
...
@@ -134,7 +134,10 @@ void my_end(int infoflag)
*/
*/
FILE
*
info_file
=
DBUG_FILE
;
FILE
*
info_file
=
DBUG_FILE
;
my_bool
print_info
=
(
info_file
!=
stderr
);
my_bool
print_info
=
(
info_file
!=
stderr
);
DBUG_ENTER
(
"my_end"
);
/* We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
operational, so we cannot use DBUG_RETURN.
*/
DBUG_PRINT
(
"info"
,(
"Shutting down"
));
if
(
!
info_file
)
if
(
!
info_file
)
{
{
info_file
=
stderr
;
info_file
=
stderr
;
...
@@ -214,7 +217,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
...
@@ -214,7 +217,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
WSACleanup
();
WSACleanup
();
#endif
/* __WIN__ */
#endif
/* __WIN__ */
my_init_done
=
0
;
my_init_done
=
0
;
DBUG_VOID_RETURN
;
}
/* my_end */
}
/* my_end */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment