Skip to content

Commit

Permalink
timer: kill unused g_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
liewegas committed Mar 9, 2010
1 parent fe4f42b commit e976c53
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/common/Timer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include <sys/time.h>
#include <math.h>

// single global instance
Timer g_timer;



/**** thread solution *****/

Expand Down
13 changes: 5 additions & 8 deletions src/common/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ class Timer {


/*
* SafeTimer is a wrapper around the raw Timer (or rather, g_timer, it's global
* instantiation) that protects event execution with an existing mutex. It
* provides for, among other things, reliable event cancellation on class
* destruction. The caller just needs to cancel each event (or cancel_all()),
* and then call join() to ensure any concurrently exectuting events (in other
* SafeTimer is a wrapper around the a Timer that protects event
* execution with an existing mutex. It provides for, among other
* things, reliable event cancellation on class destruction. The
* caller just needs to cancel each event (or cancel_all()), and then
* call join() to ensure any concurrently exectuting events (in other
* threads) get flushed.
*/
class SafeTimer : public Timer {
Expand Down Expand Up @@ -170,9 +170,6 @@ class SafeTimer : public Timer {
};


// single global instance
extern Timer g_timer;



#endif
1 change: 0 additions & 1 deletion src/cosd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ int main(int argc, const char **argv)
<< " " << ((g_conf.osd_journal && g_conf.osd_journal[0]) ? g_conf.osd_journal:"(no journal)")
<< std::endl;

g_timer.shutdown();
messenger->register_entity(entity_name_t::OSD(whoami));
if (!messenger)
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/fakefuse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class C_Test2 : public Context {
public:
void finish(int r) {
cout << "C_Test2->finish(" << r << ")" << std::endl;
g_timer.add_event_after(2, new C_Test);
//g_timer.add_event_after(2, new C_Test);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/fakesyn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ int main(int argc, const char **argv)
assert(nargs.empty());


if (g_conf.kill_after)
g_timer.add_event_after(g_conf.kill_after, new C_Die);
//if (g_conf.kill_after)
//g_timer.add_event_after(g_conf.kill_after, new C_Die);

if (g_conf.clock_tare) g_clock.tare();

Expand Down
2 changes: 1 addition & 1 deletion src/mds/mdstypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace std;
#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v011"


//#define MDS_REF_SET // define me for improved debug output, sanity checking
#define MDS_REF_SET // define me for improved debug output, sanity checking
//#define MDS_AUTHPIN_SET // define me for debugging auth pin leaks
//#define MDS_VERIFY_FRAGSTAT // do do (slow) sanity checking on frags

Expand Down
1 change: 0 additions & 1 deletion src/msg/FakeMessenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ int fakemessenger_do_loop()
fakemessenger_do_loop_2();
lock.Unlock();

g_timer.shutdown();
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions src/msg/SimpleMessenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2181,8 +2181,8 @@ int SimpleMessenger::start(bool nodaemon)
}

// some debug hackery?
if (g_conf.kill_after)
g_timer.add_event_after(g_conf.kill_after, new C_Die);
//if (g_conf.kill_after)
//qg_timer.add_event_after(g_conf.kill_after, new C_Die);

// go!
if (did_bind)
Expand Down

0 comments on commit e976c53

Please sign in to comment.