1
0
Fork 0

added dispatcherThreads

This commit is contained in:
Frank Celler 2014-08-18 12:08:33 +02:00
parent cd575e073f
commit 986bf7d0e8
4 changed files with 33 additions and 1 deletions

View File

@ -798,6 +798,7 @@ int ArangoServer::startupServer () {
_applicationV8->setVocbase(vocbase);
_applicationV8->setConcurrency(concurrency);
_applicationV8->defineGlobalConstant("DISPATCHER_THREADS", _dispatcherThreads);
// .............................................................................
// prepare everything

View File

@ -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

View File

@ -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;
};
}
}

View File

@ -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
// -----------------------------------------------------------------------------