From a4dd2fed89b0b4b17be21c19a17e4e3f9c459764 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Wed, 16 May 2012 00:17:37 -0400 Subject: [PATCH] Use static local variable for consistency with compressor, dispatch table --- src/util/select.cc | 2 -- src/util/select.h | 10 +++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/util/select.cc b/src/util/select.cc index 7d8c1ec..197f83f 100644 --- a/src/util/select.cc +++ b/src/util/select.cc @@ -18,8 +18,6 @@ #include "select.h" -Select *Select::instance = NULL; - fd_set Select::dummy_fd_set; sigset_t Select::dummy_sigset; diff --git a/src/util/select.h b/src/util/select.h index ae6226f..0b7b0a2 100644 --- a/src/util/select.h +++ b/src/util/select.h @@ -34,16 +34,12 @@ class Select { public: static Select &get_instance( void ) { - // NB: not thread-safe - if ( !instance ) { - instance = new Select; - } - return *instance; + /* COFU may or may not be thread-safe, depending on compiler */ + static Select instance; + return instance; } private: - static Select *instance; - Select() : max_fd( -1 ) , got_any_signal( 0 )