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
7776439c
Commit
7776439c
authored
Aug 30, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed so that error handler is only invoked once
parent
40593852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+12
-7
No files found.
ndb/src/kernel/main.cpp
View file @
7776439c
...
...
@@ -15,6 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <my_pthread.h>
#include <ndb_version.h>
#include "Configuration.hpp"
...
...
@@ -26,6 +27,7 @@
#include <NdbOut.hpp>
#include <NdbMain.h>
#include <NdbDaemon.h>
#include <NdbSleep.h>
#include <NdbConfig.h>
#include <WatchDog.hpp>
...
...
@@ -39,6 +41,7 @@
#endif
extern
EventLogger
g_eventLogger
;
extern
NdbMutex
*
theShutdownMutex
;
void
catchsigs
(
bool
ignore
);
// for process signal handling
...
...
@@ -328,16 +331,18 @@ handler_shutdown(int signum){
extern
"C"
void
handler_error
(
int
signum
){
// only let one thread run shutdown
static
long
thread_id
=
0
;
if
(
thread_id
!=
0
&&
thread_id
==
my_thread_id
())
;
// Shutdown thread received signal
if
(
theShutdownMutex
&&
NdbMutex_Trylock
(
theShutdownMutex
)
!=
0
)
while
(
true
)
NdbSleep_MilliSleep
(
10
);
thread_id
=
my_thread_id
();
g_eventLogger
.
info
(
"Received signal %d. Running error handler."
,
signum
);
// restart the system
char
errorData
[
40
];
snprintf
(
errorData
,
40
,
"Signal %d received"
,
signum
);
ERROR_SET
(
fatal
,
0
,
errorData
,
__FILE__
);
}
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