Commit d94a8bf7 authored by John Esmet's avatar John Esmet

FT-243 Move minicron to util/

parent d0542cb6
...@@ -51,7 +51,6 @@ set(FT_SOURCES ...@@ -51,7 +51,6 @@ set(FT_SOURCES
logfilemgr logfilemgr
logger logger
log_upgrade log_upgrade
minicron
pqueue pqueue
quicklz quicklz
recover recover
......
...@@ -93,8 +93,9 @@ PATENT RIGHTS GRANT: ...@@ -93,8 +93,9 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <fcntl.h> #include <fcntl.h>
#include "fttypes.h"
#include "minicron.h" #include "ft/fttypes.h"
#include "util/minicron.h"
// Maintain a cache mapping from cachekeys to values (void*) // Maintain a cache mapping from cachekeys to values (void*)
// Some of the keys can be pinned. Don't pin too many or for too long. // Some of the keys can be pinned. Don't pin too many or for too long.
......
...@@ -96,9 +96,9 @@ PATENT RIGHTS GRANT: ...@@ -96,9 +96,9 @@ PATENT RIGHTS GRANT:
#include <ft/fttypes.h> #include <ft/fttypes.h>
#include <ft/ft-ops.h> #include <ft/ft-ops.h>
#include <ft/minicron.h>
#include <util/growable_array.h> #include <util/growable_array.h>
#include <util/minicron.h>
#include <util/omt.h> #include <util/omt.h>
#include <locktree/locktree.h> #include <locktree/locktree.h>
......
...@@ -4,6 +4,7 @@ set(util_srcs ...@@ -4,6 +4,7 @@ set(util_srcs
kibbutz kibbutz
memarena memarena
mempool mempool
minicron
partitioned_counter partitioned_counter
queue queue
threadpool threadpool
......
...@@ -92,9 +92,8 @@ PATENT RIGHTS GRANT: ...@@ -92,9 +92,8 @@ PATENT RIGHTS GRANT:
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include "toku_assert.h" #include "portability/toku_assert.h"
#include "fttypes.h" #include "util/minicron.h"
#include "minicron.h"
static void static void
toku_gettime (toku_timespec_t *a) { toku_gettime (toku_timespec_t *a) {
......
...@@ -93,7 +93,6 @@ PATENT RIGHTS GRANT: ...@@ -93,7 +93,6 @@ PATENT RIGHTS GRANT:
#include <toku_pthread.h> #include <toku_pthread.h>
#include <toku_time.h> #include <toku_time.h>
#include "fttypes.h"
// Specification: // Specification:
......
...@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT: ...@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <toku_portability.h> #include <toku_portability.h>
#include "test.h" #include "test.h"
#include "minicron.h" #include "util/minicron.h"
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
...@@ -125,7 +125,7 @@ static void* ...@@ -125,7 +125,7 @@ static void*
test1 (void* v) test1 (void* v)
{ {
struct minicron m; struct minicron m;
ZERO_STRUCT(m); memset(&m, 0, sizeof(struct minicron));
int r = toku_minicron_setup(&m, 0, never_run, 0); assert(r==0); int r = toku_minicron_setup(&m, 0, never_run, 0); assert(r==0);
sleep(1); sleep(1);
r = toku_minicron_shutdown(&m); assert(r==0); r = toku_minicron_shutdown(&m); assert(r==0);
...@@ -137,7 +137,7 @@ static void* ...@@ -137,7 +137,7 @@ static void*
test2 (void* v) test2 (void* v)
{ {
struct minicron m; struct minicron m;
ZERO_STRUCT(m); memset(&m, 0, sizeof(struct minicron));
int r = toku_minicron_setup(&m, 10000, never_run, 0); assert(r==0); int r = toku_minicron_setup(&m, 10000, never_run, 0); assert(r==0);
sleep(2); sleep(2);
r = toku_minicron_shutdown(&m); assert(r==0); r = toku_minicron_shutdown(&m); assert(r==0);
...@@ -174,7 +174,7 @@ test3 (void* v) ...@@ -174,7 +174,7 @@ test3 (void* v)
struct tenx tx; struct tenx tx;
gettimeofday(&tx.tv, 0); gettimeofday(&tx.tv, 0);
tx.counter=0; tx.counter=0;
ZERO_STRUCT(m); memset(&m, 0, sizeof(struct minicron));
int r = toku_minicron_setup(&m, 1000, run_5x, &tx); assert(r==0); int r = toku_minicron_setup(&m, 1000, run_5x, &tx); assert(r==0);
sleep(5); sleep(5);
r = toku_minicron_shutdown(&m); assert(r==0); r = toku_minicron_shutdown(&m); assert(r==0);
...@@ -197,7 +197,7 @@ static void* ...@@ -197,7 +197,7 @@ static void*
test4 (void *v) { test4 (void *v) {
struct minicron m; struct minicron m;
int counter = 0; int counter = 0;
ZERO_STRUCT(m); memset(&m, 0, sizeof(struct minicron));
int r = toku_minicron_setup(&m, 2000, run_3sec, &counter); assert(r==0); int r = toku_minicron_setup(&m, 2000, run_3sec, &counter); assert(r==0);
sleep(10); sleep(10);
r = toku_minicron_shutdown(&m); assert(r==0); r = toku_minicron_shutdown(&m); assert(r==0);
...@@ -209,7 +209,7 @@ static void* ...@@ -209,7 +209,7 @@ static void*
test5 (void *v) { test5 (void *v) {
struct minicron m; struct minicron m;
int counter = 0; int counter = 0;
ZERO_STRUCT(m); memset(&m, 0, sizeof(struct minicron));
int r = toku_minicron_setup(&m, 10000, run_3sec, &counter); assert(r==0); int r = toku_minicron_setup(&m, 10000, run_3sec, &counter); assert(r==0);
toku_minicron_change_period(&m, 2000); toku_minicron_change_period(&m, 2000);
sleep(10); sleep(10);
...@@ -221,7 +221,7 @@ test5 (void *v) { ...@@ -221,7 +221,7 @@ test5 (void *v) {
static void* static void*
test6 (void *v) { test6 (void *v) {
struct minicron m; struct minicron m;
ZERO_STRUCT(m); memset(&m, 0, sizeof(struct minicron));
int r = toku_minicron_setup(&m, 5000, never_run, 0); assert(r==0); int r = toku_minicron_setup(&m, 5000, never_run, 0); assert(r==0);
toku_minicron_change_period(&m, 0); toku_minicron_change_period(&m, 0);
sleep(7); sleep(7);
...@@ -233,8 +233,8 @@ test6 (void *v) { ...@@ -233,8 +233,8 @@ test6 (void *v) {
static void* static void*
test7 (void *v) { test7 (void *v) {
struct minicron m; struct minicron m;
memset(&m, 0, sizeof(struct minicron));
int counter = 0; int counter = 0;
ZERO_STRUCT(m);
int r = toku_minicron_setup(&m, 5000, run_3sec, &counter); assert(r==0); int r = toku_minicron_setup(&m, 5000, run_3sec, &counter); assert(r==0);
sleep(17); sleep(17);
r = toku_minicron_shutdown(&m); assert(r==0); r = toku_minicron_shutdown(&m); assert(r==0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment