task.cpp revision 0
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
# include "incls/_precompiled.incl"
# include "incls/_task.cpp.incl"
int PeriodicTask::_num_tasks = 0;
#ifndef PRODUCT
int PeriodicTask::_ticks;
void PeriodicTask::print_intervals() {
if (ProfilerCheckIntervals) {
for (int i = 0; i < PeriodicTask::max_interval; i++) {
int n = _intervalHistogram[i];
}
}
}
#endif
#ifndef PRODUCT
if (ProfilerCheckIntervals) {
_ticks++;
_intervalHistogram[ms]++;
}
#endif
int orig_num_tasks = _num_tasks;
index--; // re-do current slot as it has changed
}
}
}
// Sanity check the interval time
"improper PeriodicTask interval time");
}
PeriodicTask::~PeriodicTask() {
if (is_enrolled())
disenroll();
}
bool PeriodicTask::is_enrolled() const {
return false;
}
void PeriodicTask::enroll() {
fatal("Overflow in PeriodicTask table");
_tasks[_num_tasks++] = this;
}
void PeriodicTask::disenroll() {
"dynamic disenrollment currently only handled from WatcherThread from within task() method");
int index;
if (index == _num_tasks) return;
_num_tasks--;
}
}
void TimeMillisUpdateTask::task() {
os::update_global_time();
}
void TimeMillisUpdateTask::engage() {
os::enable_global_time();
}
void TimeMillisUpdateTask::disengage() {
delete _task;
}