1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into spdvpk

This commit is contained in:
Jan Steemann 2016-03-02 15:21:37 +01:00
commit 1ca358bde8
4 changed files with 23 additions and 5 deletions

View File

@ -182,6 +182,8 @@ else ()
set(BASE_FLAGS)
set(BASE_C_FLAGS ${CMAKE_C_FLAGS})
set(BASE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(BASE_LD_FLAGS $ENV{LDFLAGS})
set(BASE_LIBS $ENV{LIBS})
endif ()
if (SOLARIS)
@ -226,7 +228,11 @@ if (MSVC)
set(MSVC_LIBS crypt32.lib;WINMM.LIB;Ws2_32.lib;getopt;regex)
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE /LTCG /SAFESEH:NO /MACHINE:x64 /ignore:4099"
"${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE /LTCG /SAFESEH:NO /MACHINE:x64 /ignore:4099 ${BASE_LD_FLAGS}"
)
else ()
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} ${BASE_LD_FLAGS}"
)
endif ()
@ -477,6 +483,14 @@ if (VERBOSE)
message(STATUS "${BASE_CXX_FLAGS}")
message(STATUS)
message(STATUS "Info BASE_LD_FLAGS")
message(STATUS "${BASE_LD_FLAGS}")
message(STATUS)
message(STATUS "Info BASE_LIBS")
message(STATUS "${BASE_LIBS}")
message(STATUS)
message(STATUS "Info CMAKE_C_FLAGS")
message(STATUS "${CMAKE_C_FLAGS}")
message(STATUS)
@ -700,6 +714,7 @@ list(INSERT SYSTEM_LIBRARIES 0
${ZLIB_LIBS}
${ICU_LIBS}
${OPENSSL_LIBRARIES}
${BASE_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS}
)

View File

@ -448,6 +448,7 @@ int ArangoServer::start() {
} else if (_daemonMode) {
return startupDaemon();
} else {
InitializeWorkMonitor();
_applicationServer->setupLogging(true, false, false);
if (!_pidFile.empty()) {
@ -1360,7 +1361,6 @@ void ArangoServer::buildApplicationServer() {
}
int ArangoServer::startupServer() {
InitializeWorkMonitor();
TRI_InitializeStatistics();
OperationMode::server_operation_mode_e mode =

View File

@ -722,7 +722,7 @@ static void QueueMessage(char const* function, char const* file, long int line,
class LogThread : public Thread {
public:
explicit LogThread(std::string const& name) : Thread(name) {}
~LogThread() {shutdown();}
~LogThread() { shutdown(); }
public:
void run();
@ -748,6 +748,7 @@ void LogThread::run() {
delete msg;
}
}
////////////////////////////////////////////////////////////////////////////////
/// @brief LogTopic
////////////////////////////////////////////////////////////////////////////////
@ -1146,7 +1147,7 @@ void Logger::initialize(bool threaded) {
LoggingActive.store(true);
// generate threaded logging?
ThreadedLogging.store(threaded, std::memory_order_relaxed);
ThreadedLogging.store(threaded, std::memory_order_seq_cst);
if (threaded) {
LoggingThread = std::make_unique<LogThread>("Logging");
@ -1173,9 +1174,9 @@ void Logger::shutdown(bool clearBuffers) {
return;
}
// logging is now inactive (this will terminate the logging thread)
LoggingActive.store(false, std::memory_order_seq_cst);
// logging is now inactive (this will terminate the logging thread)
// join with the logging thread
if (ThreadedLogging) {
// ignore all errors for now as we cannot log them anywhere...

View File

@ -156,10 +156,12 @@ Thread::~Thread() {
#endif
}
#ifdef TRI_HAVE_POSIX_THREADS
if (_state.load() != ThreadState::DETACHED) {
LOG(FATAL) << "thread is not detached, hard shutdown";
FATAL_ERROR_EXIT();
}
#endif
}
////////////////////////////////////////////////////////////////////////////////