Exemple #1
0
        bool StartPooler()
        {
            try
            {
                if (_pooler == null)
                    _pooler = new RessourcePooler();

                if (SystemInfo == null)
                    SystemInfo = new SystemInfo();

                if (_poolerThread == null)
                    _poolerThread = new Thread(new ParameterizedThreadStart(_pooler.PoolerMain));

                _poolerThread.Start(SystemInfo);

                while (!_poolerThread.IsAlive) ;

                IsPoolerStarted = true;

                return true;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return false;
            }
        }
Exemple #2
0
        bool StartPooler()
        {
            try
            {
                if (_pooler == null)
                {
                    _pooler = new RessourcePooler();
                }

                if (SystemInfo == null)
                {
                    SystemInfo = new SystemInfo();
                }

                if (_poolerThread == null)
                {
                    _poolerThread = new Thread(new ParameterizedThreadStart(_pooler.PoolerMain));
                }

                _poolerThread.Start(SystemInfo);

                while (!_poolerThread.IsAlive)
                {
                    ;
                }

                IsPoolerStarted = true;

                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(false);
            }
        }