2014-12-18 18:50:47 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
2014-09-10 01:54:53 +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
|
|
|
|
2014-09-16 07:28:23 +00:00
|
|
|
/**
|
|
|
|
* @brief Launch the scheduler.
|
2014-09-15 20:11:39 +00:00
|
|
|
*
|
2014-09-16 07:28:23 +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
|
|
|
*
|
2014-09-16 07:28:23 +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();
|
2015-01-12 20:53:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
}
|