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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8888980d
Commit
8888980d
authored
Nov 15, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wl1744 - ndb on windows
parent
3029bbdb
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
181 additions
and
207 deletions
+181
-207
ndb/config/win-lib.am
ndb/config/win-lib.am
+2
-61
ndb/include/kernel/signaldata/UtilLock.hpp
ndb/include/kernel/signaldata/UtilLock.hpp
+12
-12
ndb/include/ndb_global.h.in
ndb/include/ndb_global.h.in
+2
-2
ndb/src/common/transporter/Transporter.cpp
ndb/src/common/transporter/Transporter.cpp
+1
-1
ndb/src/common/util/SocketClient.cpp
ndb/src/common/util/SocketClient.cpp
+10
-10
ndb/src/kernel/vm/Callback.hpp
ndb/src/kernel/vm/Callback.hpp
+0
-7
ndb/src/kernel/vm/Configuration.cpp
ndb/src/kernel/vm/Configuration.cpp
+5
-5
ndb/src/kernel/vm/Mutex.cpp
ndb/src/kernel/vm/Mutex.cpp
+29
-24
ndb/src/kernel/vm/Mutex.hpp
ndb/src/kernel/vm/Mutex.hpp
+24
-78
ndb/src/kernel/vm/SectionReader.cpp
ndb/src/kernel/vm/SectionReader.cpp
+1
-1
ndb/src/kernel/vm/SectionReader.hpp
ndb/src/kernel/vm/SectionReader.hpp
+1
-1
ndb/src/kernel/vm/SimulatedBlock.cpp
ndb/src/kernel/vm/SimulatedBlock.cpp
+1
-1
ndb/src/kernel/vm/SimulatedBlock.hpp
ndb/src/kernel/vm/SimulatedBlock.hpp
+67
-2
ndb/src/mgmclient/Makefile.am
ndb/src/mgmclient/Makefile.am
+25
-1
ndb/test/src/Makefile.am
ndb/test/src/Makefile.am
+1
-1
No files found.
ndb/config/win-lib.am
View file @
8888980d
...
...
@@ -19,8 +19,6 @@ CFG=@name@ - Win32 Debug
!MESSAGE
!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "@name@ - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE "@name@ - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
...
...
@@ -54,7 +52,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:".
.
\lib_release\@name@.lib"
# ADD LIB32 /nologo /out:".\lib_release\@name@.lib"
@release_libs@
!ELSEIF "$(CFG)" == "@name@ - Win32 Debug"
...
...
@@ -81,72 +79,15 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:".
.
\lib_debug\@name@.lib"
# ADD LIB32 /nologo /out:".\lib_debug\@name@.lib"
@debug_libs@
!ELSEIF "$(CFG)" == "@name@ - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "@name@___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "@name@___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "@name@___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "@name@___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
# ADD BASE CPP @includes@
# ADD CPP @includes@
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib"
@tls_debug_libs@
!ELSEIF "$(CFG)" == "@name@ - Win32 TLS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "@name@___Win32_TLS"
# PROP BASE Intermediate_Dir "@name@___Win32_TLS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "@name@___Win32_TLS"
# PROP Intermediate_Dir "@name@___Win32_TLS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
# ADD BASE CPP @includes@
# ADD CPP @includes@
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\@name@_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_release\@name@_tls.lib"
@tls_release_libs@
!ENDIF
# Begin Target
# Name "@name@ - Win32 Release"
# Name "@name@ - Win32 Debug"
# Name "@name@ - Win32 TLS_DEBUG"
# Name "@name@ - Win32 TLS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
...
...
ndb/include/kernel/signaldata/UtilLock.hpp
View file @
8888980d
...
...
@@ -39,7 +39,7 @@ public:
enum
RequestInfo
{
TryLock
=
1
};
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -63,7 +63,7 @@ class UtilLockConf {
public:
STATIC_CONST
(
SignalLength
=
4
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -95,7 +95,7 @@ public:
LockAlreadyHeld
=
4
};
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -119,7 +119,7 @@ class UtilUnlockReq {
public:
STATIC_CONST
(
SignalLength
=
4
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -143,7 +143,7 @@ class UtilUnlockConf {
public:
STATIC_CONST
(
SignalLength
=
3
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -171,7 +171,7 @@ public:
NoSuchLock
=
1
,
NotLockOwner
=
2
};
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -200,7 +200,7 @@ public:
STATIC_CONST
(
SignalLength
=
4
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -229,7 +229,7 @@ public:
STATIC_CONST
(
SignalLength
=
4
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -251,7 +251,7 @@ class UtilCreateLockConf {
public:
STATIC_CONST
(
SignalLength
=
3
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -275,7 +275,7 @@ class UtilDestroyLockReq {
public:
STATIC_CONST
(
SignalLength
=
4
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -303,7 +303,7 @@ public:
STATIC_CONST
(
SignalLength
=
4
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
@@ -325,7 +325,7 @@ class UtilDestroyLockConf {
public:
STATIC_CONST
(
SignalLength
=
3
);
p
rivate
:
p
ublic
:
Uint32
senderData
;
Uint32
senderRef
;
Uint32
lockId
;
...
...
ndb/include/ndb_global.h.in
View file @
8888980d
...
...
@@ -16,8 +16,8 @@
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define HAVE_STRCASECMP
#define strcasecmp
(a,b) _strcmpi(a,b)
#define strncasecmp
(a,b) _strncmpi(a,b)
#define strcasecmp
_strcmpi
#define strncasecmp
_strncmpi
#pragma warning(disable: 4503 4786)
#else
#undef NDB_WIN32
...
...
ndb/src/common/transporter/Transporter.cpp
View file @
8888980d
...
...
@@ -95,7 +95,7 @@ Transporter::connect_client() {
return
true
;
NDB_SOCKET_TYPE
sockfd
=
m_socket_client
->
connect
();
if
(
sockfd
<
0
)
if
(
sockfd
==
NDB_INVALID_SOCKET
)
return
false
;
// send info about own id
...
...
ndb/src/common/util/SocketClient.cpp
View file @
8888980d
...
...
@@ -26,14 +26,14 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA
m_auth
=
sa
;
m_port
=
port
;
m_server_name
=
strdup
(
server_name
);
m_sockfd
=
-
1
;
m_sockfd
=
NDB_INVALID_SOCKET
;
}
SocketClient
::~
SocketClient
()
{
if
(
m_server_name
)
free
(
m_server_name
);
if
(
m_sockfd
>=
0
)
if
(
m_sockfd
!=
NDB_INVALID_SOCKET
)
NDB_CLOSE_SOCKET
(
m_sockfd
);
if
(
m_auth
)
delete
m_auth
;
...
...
@@ -42,7 +42,7 @@ SocketClient::~SocketClient()
bool
SocketClient
::
init
()
{
if
(
m_sockfd
>=
0
)
if
(
m_sockfd
!=
NDB_INVALID_SOCKET
)
NDB_CLOSE_SOCKET
(
m_sockfd
);
memset
(
&
m_servaddr
,
0
,
sizeof
(
m_servaddr
));
...
...
@@ -63,32 +63,32 @@ SocketClient::init()
NDB_SOCKET_TYPE
SocketClient
::
connect
()
{
if
(
m_sockfd
<
0
)
if
(
m_sockfd
==
NDB_INVALID_SOCKET
)
{
if
(
!
init
())
{
#ifdef VM_TRACE
ndbout
<<
"SocketClient::connect() failed "
<<
m_server_name
<<
" "
<<
m_port
<<
endl
;
#endif
return
-
1
;
return
NDB_INVALID_SOCKET
;
}
}
const
int
r
=
::
connect
(
m_sockfd
,
(
struct
sockaddr
*
)
&
m_servaddr
,
sizeof
(
m_servaddr
));
if
(
r
==
-
1
)
{
NDB_CLOSE_SOCKET
(
m_sockfd
);
m_sockfd
=
-
1
;
return
-
1
;
m_sockfd
=
NDB_INVALID_SOCKET
;
return
NDB_INVALID_SOCKET
;
}
if
(
m_auth
)
{
if
(
!
m_auth
->
client_authenticate
(
m_sockfd
))
{
NDB_CLOSE_SOCKET
(
m_sockfd
);
m_sockfd
=
-
1
;
return
-
1
;
m_sockfd
=
NDB_INVALID_SOCKET
;
return
NDB_INVALID_SOCKET
;
}
}
NDB_SOCKET_TYPE
sockfd
=
m_sockfd
;
m_sockfd
=
-
1
;
m_sockfd
=
NDB_INVALID_SOCKET
;
return
sockfd
;
}
ndb/src/kernel/vm/Callback.hpp
View file @
8888980d
...
...
@@ -20,12 +20,5 @@
/**
* Block callbacks
*/
typedef
void
(
SimulatedBlock
::*
CallbackFunction
)(
class
Signal
*
,
Uint32
callbackData
,
Uint32
returnCode
);
struct
Callback
{
CallbackFunction
m_callbackFunction
;
Uint32
m_callbackData
;
};
#endif
ndb/src/kernel/vm/Configuration.cpp
View file @
8888980d
...
...
@@ -279,18 +279,18 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter,
#ifdef NDB_WIN32
char
*
szFilePart
;
if
(
!
GetFullPathName
(
path
,
sizeof
(
buf2
),
buf2
,
&
szFilePart
)
||
(
GetFileAttributes
(
buf2
)
&
FILE_ATTRIBUTE_READONLY
))
;
(
GetFileAttributes
(
buf2
)
&
FILE_ATTRIBUTE_READONLY
))
#else
if
((
::
realpath
(
path
,
buf2
)
==
NULL
)
||
(
::
access
(
buf2
,
W_OK
)
!=
0
))
#endif
{
ERROR_SET
(
fatal
,
AFS_ERROR_INVALIDPATH
,
path
,
" Filename::init()"
);
}
ERROR_SET
(
fatal
,
AFS_ERROR_INVALIDPATH
,
path
,
" Filename::init()"
);
}
if
(
strcmp
(
&
buf2
[
strlen
(
buf2
)
-
1
],
DIR_SEPARATOR
))
strcat
(
buf2
,
DIR_SEPARATOR
);
return
strdup
(
buf2
);
}
...
...
ndb/src/kernel/vm/Mutex.cpp
View file @
8888980d
...
...
@@ -19,48 +19,51 @@
#include "Mutex.hpp"
#include <signaldata/UtilLock.hpp>
MutexManager
::
MutexManager
(
class
SimulatedBlock
&
block
)
SimulatedBlock
::
MutexManager
::
MutexManager
(
class
SimulatedBlock
&
block
)
:
m_block
(
block
),
m_activeMutexes
(
m_mutexPool
)
{
}
bool
MutexManager
::
setSize
(
Uint32
maxNoOfActiveMutexes
){
SimulatedBlock
::
MutexManager
::
setSize
(
Uint32
maxNoOfActiveMutexes
){
return
m_mutexPool
.
setSize
(
maxNoOfActiveMutexes
);
}
Uint32
MutexManager
::
getSize
()
const
{
SimulatedBlock
::
MutexManager
::
getSize
()
const
{
return
m_mutexPool
.
getSize
();
}
bool
MutexManager
::
seize
(
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
seize
(
ActiveMutexPtr
&
ptr
){
return
m_activeMutexes
.
seize
(
ptr
);
}
void
MutexManager
::
release
(
Uint32
activeMutexPtrI
){
SimulatedBlock
::
MutexManager
::
release
(
Uint32
activeMutexPtrI
){
m_activeMutexes
.
release
(
activeMutexPtrI
);
}
void
MutexManager
::
getPtr
(
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
getPtr
(
ActiveMutexPtr
&
ptr
){
m_activeMutexes
.
getPtr
(
ptr
);
}
BlockReference
MutexManager
::
reference
()
const
{
SimulatedBlock
::
MutexManager
::
reference
()
const
{
return
m_block
.
reference
();
}
void
MutexManager
::
progError
(
int
line
,
int
err_code
,
const
char
*
extra
)
{
SimulatedBlock
::
MutexManager
::
progError
(
int
line
,
int
err_code
,
const
char
*
extra
)
{
m_block
.
progError
(
line
,
err_code
,
extra
);
}
void
MutexManager
::
create
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
create
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
UtilCreateLockReq
*
req
=
(
UtilCreateLockReq
*
)
signal
->
getDataPtrSend
();
req
->
senderData
=
ptr
.
i
;
...
...
@@ -78,7 +81,7 @@ MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){
}
void
MutexManager
::
execUTIL_CREATE_LOCK_REF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_CREATE_LOCK_REF
(
Signal
*
signal
){
UtilCreateLockRef
*
ref
=
(
UtilCreateLockRef
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
...
...
@@ -91,7 +94,7 @@ MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){
}
void
MutexManager
::
execUTIL_CREATE_LOCK_CONF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_CREATE_LOCK_CONF
(
Signal
*
signal
){
UtilCreateLockConf
*
conf
=
(
UtilCreateLockConf
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
...
...
@@ -105,7 +108,7 @@ MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){
void
MutexManager
::
destroy
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
destroy
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
UtilDestroyLockReq
*
req
=
(
UtilDestroyLockReq
*
)
signal
->
getDataPtrSend
();
req
->
senderData
=
ptr
.
i
;
...
...
@@ -123,7 +126,7 @@ MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){
}
void
MutexManager
::
execUTIL_DESTORY_LOCK_REF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_DESTORY_LOCK_REF
(
Signal
*
signal
){
UtilDestroyLockRef
*
ref
=
(
UtilDestroyLockRef
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
m_activeMutexes
.
getPtr
(
ptr
,
ref
->
senderData
);
...
...
@@ -135,7 +138,7 @@ MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){
}
void
MutexManager
::
execUTIL_DESTORY_LOCK_CONF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_DESTORY_LOCK_CONF
(
Signal
*
signal
){
UtilDestroyLockConf
*
conf
=
(
UtilDestroyLockConf
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
m_activeMutexes
.
getPtr
(
ptr
,
conf
->
senderData
);
...
...
@@ -148,7 +151,7 @@ MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){
void
MutexManager
::
lock
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
lock
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
UtilLockReq
*
req
=
(
UtilLockReq
*
)
signal
->
getDataPtrSend
();
req
->
senderData
=
ptr
.
i
;
...
...
@@ -166,7 +169,7 @@ MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){
}
void
MutexManager
::
trylock
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
trylock
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
UtilLockReq
*
req
=
(
UtilLockReq
*
)
signal
->
getDataPtrSend
();
req
->
senderData
=
ptr
.
i
;
...
...
@@ -184,7 +187,7 @@ MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){
}
void
MutexManager
::
execUTIL_LOCK_REF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_LOCK_REF
(
Signal
*
signal
){
UtilLockRef
*
ref
=
(
UtilLockRef
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
m_activeMutexes
.
getPtr
(
ptr
,
ref
->
senderData
);
...
...
@@ -196,7 +199,7 @@ MutexManager::execUTIL_LOCK_REF(Signal* signal){
}
void
MutexManager
::
execUTIL_LOCK_CONF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_LOCK_CONF
(
Signal
*
signal
){
UtilLockConf
*
conf
=
(
UtilLockConf
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
m_activeMutexes
.
getPtr
(
ptr
,
conf
->
senderData
);
...
...
@@ -210,7 +213,7 @@ MutexManager::execUTIL_LOCK_CONF(Signal* signal){
}
void
MutexManager
::
unlock
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
SimulatedBlock
::
MutexManager
::
unlock
(
Signal
*
signal
,
ActiveMutexPtr
&
ptr
){
UtilUnlockReq
*
req
=
(
UtilUnlockReq
*
)
signal
->
getDataPtrSend
();
req
->
senderData
=
ptr
.
i
;
req
->
senderRef
=
m_block
.
reference
();
...
...
@@ -227,7 +230,7 @@ MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){
}
void
MutexManager
::
execUTIL_UNLOCK_REF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_UNLOCK_REF
(
Signal
*
signal
){
UtilUnlockRef
*
ref
=
(
UtilUnlockRef
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
m_activeMutexes
.
getPtr
(
ptr
,
ref
->
senderData
);
...
...
@@ -239,7 +242,7 @@ MutexManager::execUTIL_UNLOCK_REF(Signal* signal){
}
void
MutexManager
::
execUTIL_UNLOCK_CONF
(
Signal
*
signal
){
SimulatedBlock
::
MutexManager
::
execUTIL_UNLOCK_CONF
(
Signal
*
signal
){
UtilUnlockConf
*
conf
=
(
UtilUnlockConf
*
)
signal
->
getDataPtr
();
ActiveMutexPtr
ptr
;
m_activeMutexes
.
getPtr
(
ptr
,
conf
->
senderData
);
...
...
@@ -251,8 +254,9 @@ MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){
}
void
Mutex
::
release
(
MutexManager
&
mgr
,
Uint32
activePtrI
,
Uint32
mutexId
){
MutexManager
::
ActiveMutexPtr
ptr
;
Mutex
::
release
(
SimulatedBlock
::
MutexManager
&
mgr
,
Uint32
activePtrI
,
Uint32
mutexId
){
SimulatedBlock
::
MutexManager
::
ActiveMutexPtr
ptr
;
ptr
.
i
=
activePtrI
;
mgr
.
getPtr
(
ptr
);
if
(
ptr
.
p
->
m_gsn
==
0
&&
ptr
.
p
->
m_mutexId
==
mutexId
){
...
...
@@ -272,7 +276,8 @@ Mutex::unlock(){
if
(
!
m_ptr
.
isNull
()){
m_mgr
.
getPtr
(
m_ptr
);
if
(
m_ptr
.
p
->
m_mutexId
==
m_mutexId
){
Callback
c
=
{
&
SimulatedBlock
::
ignoreMutexUnlockCallback
,
m_ptr
.
i
};
SimulatedBlock
::
Callback
c
=
{
&
SimulatedBlock
::
ignoreMutexUnlockCallback
,
m_ptr
.
i
};
m_ptr
.
p
->
m_callback
=
c
;
m_mgr
.
unlock
(
m_signal
,
m_ptr
);
m_ptr
.
setNull
();
// Remove reference
...
...
ndb/src/kernel/vm/Mutex.hpp
View file @
8888980d
...
...
@@ -22,63 +22,6 @@
class
Mutex
;
class
MutexManager
{
friend
class
Mutex
;
friend
class
SimulatedBlock
;
friend
class
DbUtil
;
public:
MutexManager
(
class
SimulatedBlock
&
);
bool
setSize
(
Uint32
maxNoOfActiveMutexes
);
Uint32
getSize
()
const
;
// Get maxNoOfActiveMutexes
private:
/**
* core interface
*/
struct
ActiveMutex
{
Uint32
m_gsn
;
// state
Uint32
m_mutexId
;
Uint32
m_mutexKey
;
Callback
m_callback
;
union
{
Uint32
nextPool
;
Uint32
nextList
;
};
Uint32
prevList
;
};
typedef
Ptr
<
ActiveMutex
>
ActiveMutexPtr
;
bool
seize
(
ActiveMutexPtr
&
ptr
);
void
release
(
Uint32
activeMutexPtrI
);
void
getPtr
(
ActiveMutexPtr
&
ptr
);
void
create
(
Signal
*
,
ActiveMutexPtr
&
);
void
destroy
(
Signal
*
,
ActiveMutexPtr
&
);
void
lock
(
Signal
*
,
ActiveMutexPtr
&
);
void
trylock
(
Signal
*
,
ActiveMutexPtr
&
);
void
unlock
(
Signal
*
,
ActiveMutexPtr
&
);
private:
void
execUTIL_CREATE_LOCK_REF
(
Signal
*
signal
);
void
execUTIL_CREATE_LOCK_CONF
(
Signal
*
signal
);
void
execUTIL_DESTORY_LOCK_REF
(
Signal
*
signal
);
void
execUTIL_DESTORY_LOCK_CONF
(
Signal
*
signal
);
void
execUTIL_LOCK_REF
(
Signal
*
signal
);
void
execUTIL_LOCK_CONF
(
Signal
*
signal
);
void
execUTIL_UNLOCK_REF
(
Signal
*
signal
);
void
execUTIL_UNLOCK_CONF
(
Signal
*
signal
);
SimulatedBlock
&
m_block
;
ArrayPool
<
ActiveMutex
>
m_mutexPool
;
DLList
<
ActiveMutex
>
m_activeMutexes
;
BlockReference
reference
()
const
;
void
progError
(
int
line
,
int
err_code
,
const
char
*
extra
=
0
);
};
/**
* MutexHandle - A "reference" to a mutex
* - Should be used together with Mutex
...
...
@@ -89,7 +32,7 @@ public:
MutexHandle
(
Uint32
id
);
bool
isNull
()
const
;
void
release
(
MutexManager
&
mgr
);
void
release
(
SimulatedBlock
::
MutexManager
&
mgr
);
private:
const
Uint32
m_mutexId
;
...
...
@@ -106,7 +49,7 @@ public:
MutexHandle2
();
bool
isNull
()
const
;
void
release
(
MutexManager
&
mgr
);
void
release
(
SimulatedBlock
::
MutexManager
&
mgr
);
private:
Uint32
m_activeMutexPtrI
;
...
...
@@ -117,33 +60,34 @@ private:
*/
class
Mutex
{
public:
Mutex
(
Signal
*
,
MutexManager
&
mgr
,
MutexHandle
&
);
Mutex
(
Signal
*
,
SimulatedBlock
::
MutexManager
&
mgr
,
MutexHandle
&
);
template
<
Uint32
MutexId
>
Mutex
(
Signal
*
,
MutexManager
&
mgr
,
MutexHandle2
<
MutexId
>
&
);
Mutex
(
Signal
*
,
SimulatedBlock
::
MutexManager
&
mgr
,
MutexHandle2
<
MutexId
>
&
);
~
Mutex
();
void
release
();
bool
isNull
()
const
;
bool
lock
(
Callback
&
callback
);
bool
trylock
(
Callback
&
callback
);
void
unlock
(
Callback
&
callback
);
bool
lock
(
SimulatedBlock
::
Callback
&
callback
);
bool
trylock
(
SimulatedBlock
::
Callback
&
callback
);
void
unlock
(
SimulatedBlock
::
Callback
&
callback
);
void
unlock
();
// Ignore callback
bool
create
(
Callback
&
callback
);
bool
destroy
(
Callback
&
callback
);
bool
create
(
SimulatedBlock
::
Callback
&
callback
);
bool
destroy
(
SimulatedBlock
::
Callback
&
callback
);
private:
Signal
*
m_signal
;
MutexManager
&
m_mgr
;
SimulatedBlock
::
MutexManager
&
m_mgr
;
const
Uint32
m_mutexId
;
Uint32
&
m_srcPtrI
;
MutexManager
::
ActiveMutexPtr
m_ptr
;
SimulatedBlock
::
MutexManager
::
ActiveMutexPtr
m_ptr
;
public:
static
void
release
(
MutexManager
&
,
Uint32
activePtrI
,
Uint32
mutexId
);
static
void
release
(
SimulatedBlock
::
MutexManager
&
,
Uint32
activePtrI
,
Uint32
mutexId
);
};
inline
...
...
@@ -159,7 +103,7 @@ MutexHandle::isNull() const {
inline
void
MutexHandle
::
release
(
MutexManager
&
mgr
){
MutexHandle
::
release
(
SimulatedBlock
::
MutexManager
&
mgr
){
if
(
!
isNull
()){
Mutex
::
release
(
mgr
,
m_activeMutexPtrI
,
m_mutexId
);
m_activeMutexPtrI
=
RNIL
;
...
...
@@ -183,7 +127,7 @@ MutexHandle2<MutexId>::isNull() const {
template
<
Uint32
MutexId
>
inline
void
MutexHandle2
<
MutexId
>::
release
(
MutexManager
&
mgr
){
MutexHandle2
<
MutexId
>::
release
(
SimulatedBlock
::
MutexManager
&
mgr
){
if
(
!
isNull
()){
Mutex
::
release
(
mgr
,
m_activeMutexPtrI
,
MutexId
);
m_activeMutexPtrI
=
RNIL
;
...
...
@@ -192,7 +136,8 @@ MutexHandle2<MutexId>::release(MutexManager & mgr){
inline
Mutex
::
Mutex
(
Signal
*
signal
,
MutexManager
&
mgr
,
MutexHandle
&
mh
)
Mutex
::
Mutex
(
Signal
*
signal
,
SimulatedBlock
::
MutexManager
&
mgr
,
MutexHandle
&
mh
)
:
m_signal
(
signal
),
m_mgr
(
mgr
),
m_mutexId
(
mh
.
m_mutexId
),
...
...
@@ -204,7 +149,8 @@ Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh)
template
<
Uint32
MutexId
>
inline
Mutex
::
Mutex
(
Signal
*
signal
,
MutexManager
&
mgr
,
MutexHandle2
<
MutexId
>
&
mh
)
Mutex
::
Mutex
(
Signal
*
signal
,
SimulatedBlock
::
MutexManager
&
mgr
,
MutexHandle2
<
MutexId
>
&
mh
)
:
m_signal
(
signal
),
m_mgr
(
mgr
),
m_mutexId
(
MutexId
),
...
...
@@ -236,7 +182,7 @@ Mutex::isNull() const {
inline
bool
Mutex
::
lock
(
Callback
&
callback
){
Mutex
::
lock
(
SimulatedBlock
::
Callback
&
callback
){
if
(
m_ptr
.
isNull
()){
if
(
m_mgr
.
seize
(
m_ptr
)){
m_ptr
.
p
->
m_mutexId
=
m_mutexId
;
...
...
@@ -253,7 +199,7 @@ Mutex::lock(Callback & callback){
inline
bool
Mutex
::
trylock
(
Callback
&
callback
){
Mutex
::
trylock
(
SimulatedBlock
::
Callback
&
callback
){
if
(
m_ptr
.
isNull
()){
if
(
m_mgr
.
seize
(
m_ptr
)){
m_ptr
.
p
->
m_mutexId
=
m_mutexId
;
...
...
@@ -270,7 +216,7 @@ Mutex::trylock(Callback & callback){
inline
void
Mutex
::
unlock
(
Callback
&
callback
){
Mutex
::
unlock
(
SimulatedBlock
::
Callback
&
callback
){
if
(
!
m_ptr
.
isNull
()){
m_mgr
.
getPtr
(
m_ptr
);
if
(
m_ptr
.
p
->
m_mutexId
==
m_mutexId
){
...
...
@@ -285,7 +231,7 @@ Mutex::unlock(Callback & callback){
inline
bool
Mutex
::
create
(
Callback
&
callback
){
Mutex
::
create
(
SimulatedBlock
::
Callback
&
callback
){
if
(
m_ptr
.
isNull
()){
if
(
m_mgr
.
seize
(
m_ptr
)){
m_ptr
.
p
->
m_mutexId
=
m_mutexId
;
...
...
@@ -302,7 +248,7 @@ Mutex::create(Callback & callback){
inline
bool
Mutex
::
destroy
(
Callback
&
callback
){
Mutex
::
destroy
(
SimulatedBlock
::
Callback
&
callback
){
if
(
m_ptr
.
isNull
()){
if
(
m_mgr
.
seize
(
m_ptr
)){
m_ptr
.
p
->
m_mutexId
=
m_mutexId
;
...
...
ndb/src/kernel/vm/SectionReader.cpp
View file @
8888980d
...
...
@@ -26,7 +26,7 @@
#endif
SectionReader
::
SectionReader
(
class
SegmentedSectionPtr
&
ptr
,
class
SectionSegmentPool
&
pool
)
(
struct
SegmentedSectionPtr
&
ptr
,
class
SectionSegmentPool
&
pool
)
:
m_pool
(
pool
)
{
if
(
ptr
.
p
==
0
){
...
...
ndb/src/kernel/vm/SectionReader.hpp
View file @
8888980d
...
...
@@ -21,7 +21,7 @@
class
SectionReader
{
public:
SectionReader
(
class
SegmentedSectionPtr
&
,
SectionReader
(
struct
SegmentedSectionPtr
&
,
class
SectionSegmentPool
&
);
void
reset
();
...
...
ndb/src/kernel/vm/SimulatedBlock.cpp
View file @
8888980d
...
...
@@ -1598,7 +1598,7 @@ SimulatedBlock::sendFragmentedSignal(NodeReceiverGroup rg,
}
}
Callback
SimulatedBlock
::
TheEmptyCallback
=
{
0
,
0
};
SimulatedBlock
::
Callback
SimulatedBlock
::
TheEmptyCallback
=
{
0
,
0
};
void
SimulatedBlock
::
sendFragmentedSignal
(
BlockReference
ref
,
...
...
ndb/src/kernel/vm/SimulatedBlock.hpp
View file @
8888980d
...
...
@@ -41,7 +41,6 @@
#include "ArrayPool.hpp"
#include "DLHashTable.hpp"
#include "Callback.hpp"
#include "Mutex.hpp"
#include "SafeCounter.hpp"
#include "MetaData.hpp"
...
...
@@ -104,6 +103,14 @@ public:
*
*/
inline
void
executeFunction
(
GlobalSignalNumber
gsn
,
Signal
*
signal
);
public:
typedef
void
(
SimulatedBlock
::*
CallbackFunction
)(
class
Signal
*
,
Uint32
callbackData
,
Uint32
returnCode
);
struct
Callback
{
CallbackFunction
m_callbackFunction
;
Uint32
m_callbackData
;
};
protected:
static
Callback
TheEmptyCallback
;
void
execute
(
Signal
*
signal
,
Callback
&
c
,
Uint32
returnCode
);
...
...
@@ -405,7 +412,63 @@ private:
DLList
<
FragmentSendInfo
>
c_linearFragmentSendList
;
DLList
<
FragmentSendInfo
>
c_segmentedFragmentSendList
;
public:
public:
class
MutexManager
{
friend
class
Mutex
;
friend
class
SimulatedBlock
;
friend
class
DbUtil
;
public:
MutexManager
(
class
SimulatedBlock
&
);
bool
setSize
(
Uint32
maxNoOfActiveMutexes
);
Uint32
getSize
()
const
;
// Get maxNoOfActiveMutexes
private:
/**
* core interface
*/
struct
ActiveMutex
{
Uint32
m_gsn
;
// state
Uint32
m_mutexId
;
Uint32
m_mutexKey
;
Callback
m_callback
;
union
{
Uint32
nextPool
;
Uint32
nextList
;
};
Uint32
prevList
;
};
typedef
Ptr
<
ActiveMutex
>
ActiveMutexPtr
;
bool
seize
(
ActiveMutexPtr
&
ptr
);
void
release
(
Uint32
activeMutexPtrI
);
void
getPtr
(
ActiveMutexPtr
&
ptr
);
void
create
(
Signal
*
,
ActiveMutexPtr
&
);
void
destroy
(
Signal
*
,
ActiveMutexPtr
&
);
void
lock
(
Signal
*
,
ActiveMutexPtr
&
);
void
trylock
(
Signal
*
,
ActiveMutexPtr
&
);
void
unlock
(
Signal
*
,
ActiveMutexPtr
&
);
private:
void
execUTIL_CREATE_LOCK_REF
(
Signal
*
signal
);
void
execUTIL_CREATE_LOCK_CONF
(
Signal
*
signal
);
void
execUTIL_DESTORY_LOCK_REF
(
Signal
*
signal
);
void
execUTIL_DESTORY_LOCK_CONF
(
Signal
*
signal
);
void
execUTIL_LOCK_REF
(
Signal
*
signal
);
void
execUTIL_LOCK_CONF
(
Signal
*
signal
);
void
execUTIL_UNLOCK_REF
(
Signal
*
signal
);
void
execUTIL_UNLOCK_CONF
(
Signal
*
signal
);
SimulatedBlock
&
m_block
;
ArrayPool
<
ActiveMutex
>
m_mutexPool
;
DLList
<
ActiveMutex
>
m_activeMutexes
;
BlockReference
reference
()
const
;
void
progError
(
int
line
,
int
err_code
,
const
char
*
extra
=
0
);
};
MutexManager
c_mutexMgr
;
void
ignoreMutexUnlockCallback
(
Signal
*
signal
,
Uint32
ptrI
,
Uint32
retVal
);
...
...
@@ -688,5 +751,7 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \
addRecSignalImpl(gsn, (ExecFunction)f, force);\
}
#include "Mutex.hpp"
#endif
ndb/src/mgmclient/Makefile.am
View file @
8888980d
...
...
@@ -24,4 +24,28 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@
# Don't update the files from bitkeeper
%
::
SCCS/s.%
windoze-dsp
:
windoze-dsp
:
ndb_mgm.dsp libndbmgmclient.dsp
ndb_mgm.dsp
:
Makefile
\
$(top_srcdir)/ndb/config/win-prg.am
\
$(top_srcdir)/ndb/config/win-name
\
$(top_srcdir)/ndb/config/win-includes
\
$(top_srcdir)/ndb/config/win-sources
\
$(top_srcdir)/ndb/config/win-libraries
cat
$(top_srcdir)
/ndb/config/win-prg.am
>
$@
@
$(top_srcdir)
/ndb/config/win-name
$@
$(ndbtools_PROGRAMS)
@
$(top_srcdir)
/ndb/config/win-includes
$@
$(INCLUDES)
@
$(top_srcdir)
/ndb/config/win-sources
$@
$(ndb_mgm_SOURCES)
@
$(top_srcdir)
/ndb/config/win-libraries
$@
LINK
$(LDADD)
libndbmgmclient.dsp
:
Makefile
\
$(top_srcdir)/ndb/config/win-lib.am
\
$(top_srcdir)/ndb/config/win-name
\
$(top_srcdir)/ndb/config/win-includes
\
$(top_srcdir)/ndb/config/win-sources
\
$(top_srcdir)/ndb/config/win-libraries
cat
$(top_srcdir)
/ndb/config/win-lib.am
>
$@
@
$(top_srcdir)
/ndb/config/win-name
$@
$(noinst_LTLIBRARIES)
@
$(top_srcdir)
/ndb/config/win-includes
$@
$(INCLUDES)
@
$(top_srcdir)
/ndb/config/win-sources
$@
$(libndbmgmclient_la_SOURCES)
@
$(top_srcdir)
/ndb/config/win-libraries
$@
LIB
ndb/test/src/Makefile.am
View file @
8888980d
...
...
@@ -32,4 +32,4 @@ libNDBT.dsp: Makefile \
@
$(top_srcdir)
/ndb/config/win-name
$@
$(noinst_LIBRARIES)
@
$(top_srcdir)
/ndb/config/win-includes
$@
$(INCLUDES)
@
$(top_srcdir)
/ndb/config/win-sources
$@
$(libNDBT_a_SOURCES)
@
$(top_srcdir)
/ndb/config/win-libraries
$@
LIB
$(LDADD)
@
$(top_srcdir)
/ndb/config/win-libraries
$@
LIB
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