1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-27 10:50:10 +03:00

F #1843: Sent scheduler like parameter

This commit is contained in:
juanmont 2018-03-22 15:57:04 +01:00
parent d19910f6e9
commit 31429d8d40
3 changed files with 12 additions and 4 deletions

View File

@ -43,14 +43,19 @@ class Scheduler: public ActionListener
{
public:
static Scheduler* sched;
void start();
virtual void register_policies(const SchedulerTemplate& conf){};
static Scheduler& instance()
static Scheduler& instance(Scheduler* the_sched=0)
{
static Scheduler _sched;
return _sched;
if ( the_sched != 0)
{
sched = the_sched;
}
return *sched;
}
float get_mem_ds_scale()

View File

@ -37,6 +37,8 @@
using namespace std;
Scheduler* Scheduler::sched = 0;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

View File

@ -15,6 +15,7 @@
/* -------------------------------------------------------------------------- */
#include "RankScheduler.h"
#include "Scheduler.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -25,7 +26,7 @@
int main(int argc, char **argv)
{
Scheduler& sched = RankScheduler::instance();
Scheduler& sched = Scheduler::instance(new RankScheduler());
try
{