osquery-1/include/osquery/scheduler.h

43 lines
1.2 KiB
C
Raw Normal View History

/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
2014-07-31 00:35:19 +00:00
#pragma once
2014-07-31 00:35:19 +00:00
2014-08-15 07:25:30 +00:00
namespace osquery {
2014-07-31 00:35:19 +00:00
/**
* @brief Launch the scheduler.
2014-09-15 20:11:39 +00:00
*
* osquery comes with a scheduler, which schedules a variety of things. This
* is one of the core parts of the osqueryd daemon. To use this, simply use
* this function as your entry point when creating a new thread.
2014-09-15 20:11:39 +00:00
*
* @code{.cpp}
* boost::thread scheduler_thread(osquery::initializeScheduler);
* // do some other stuff
* scheduler_thread.join();
* @endcode
2014-09-15 20:11:39 +00:00
*/
2014-09-15 18:26:16 +00:00
void initializeScheduler();
/**
* @brief Calculate a splayed integer based on a variable splay percentage
*
* The value of splayPercent must be between 1 and 100. If it's not, the
* value of original will be returned.
*
* @param original The original value to be modified
* @param splayPercent The percent in which to splay the original value by
*
* @return The modified version of original
*/
int splayValue(int original, int splayPercent);
2014-08-15 07:25:30 +00:00
}