mirror of https://gitee.com/bigwinds/arangodb
added dispatcherThreads
This commit is contained in:
parent
cd575e073f
commit
986bf7d0e8
|
@ -798,6 +798,7 @@ int ArangoServer::startupServer () {
|
|||
|
||||
_applicationV8->setVocbase(vocbase);
|
||||
_applicationV8->setConcurrency(concurrency);
|
||||
_applicationV8->defineGlobalConstant("DISPATCHER_THREADS", _dispatcherThreads);
|
||||
|
||||
// .............................................................................
|
||||
// prepare everything
|
||||
|
|
|
@ -834,6 +834,14 @@ void ApplicationV8::prepareServer () {
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief defines a double in all global contexts
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ApplicationV8::defineGlobalConstant (const string& name, double value) {
|
||||
_doubleGlobals[name] = value;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- ApplicationFeature methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -1092,6 +1100,10 @@ bool ApplicationV8::prepareV8Instance (const size_t i) {
|
|||
for (map<string, bool>::iterator i = _definedBooleans.begin(); i != _definedBooleans.end(); ++i) {
|
||||
TRI_AddGlobalVariableVocbase(context->_context, i->first.c_str(), v8::Boolean::New(i->second));
|
||||
}
|
||||
|
||||
for (auto i : _doubleGlobals) {
|
||||
context->_context->Global()->Set(TRI_V8_SYMBOL(i.first.c_str()), v8::Number::New(i.second), v8::ReadOnly);
|
||||
}
|
||||
}
|
||||
|
||||
// load all init files
|
||||
|
|
|
@ -349,6 +349,12 @@ namespace triagens {
|
|||
|
||||
void prepareServer ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief defines a double in all global contexts
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void defineGlobalConstant (const string& name, double value);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- ApplicationFeature methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -630,6 +636,12 @@ namespace triagens {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
volatile bool _gcFinished;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global doubles
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::map<std::string, double> _doubleGlobals;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
REPLICATION_LOGGER_STATE, REPLICATION_LOGGER_CONFIGURE, REPLICATION_SERVER_ID,
|
||||
REPLICATION_APPLIER_CONFIGURE, REPLICATION_APPLIER_START, REPLICATION_APPLIER_SHUTDOWN,
|
||||
REPLICATION_APPLIER_FORGET, REPLICATION_APPLIER_STATE, REPLICATION_SYNCHRONISE,
|
||||
ENABLE_STATISTICS */
|
||||
ENABLE_STATISTICS, DISPATCHER_THREADS */
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief module "internal"
|
||||
|
@ -89,6 +89,13 @@
|
|||
internal.enableStatistics = ENABLE_STATISTICS;
|
||||
delete ENABLE_STATISTICS;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dispatcherThreads
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal.dispatcherThreads = DISPATCHER_THREADS;
|
||||
delete DISPATCHER_THREADS;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue