diff options
author | msvensson@neptunus.(none) <> | 2005-02-21 14:04:54 +0100 |
---|---|---|
committer | msvensson@neptunus.(none) <> | 2005-02-21 14:04:54 +0100 |
commit | b4417c75722b051d7ca93cf387c17c8edb323938 (patch) | |
tree | 8ca7826104017ff5c99b49732070a716bac9221d /sql/ha_ndbcluster.cc | |
parent | b6e20e350fa9d975b0121c5e002576f78c2de2d8 (diff) | |
download | mariadb-git-b4417c75722b051d7ca93cf387c17c8edb323938.tar.gz |
Fix so that ndb-cache-check-time is measured in milliseconds
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 62bc1cc41b9..297c36580d6 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -5746,7 +5746,7 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, } List<NDB_SHARE> util_open_tables; - set_timespec(abstime, ndb_cache_check_time); + set_timespec(abstime, 0); for (;;) { @@ -5764,12 +5764,21 @@ extern "C" pthread_handler_decl(ndb_util_thread_func, if (ndb_cache_check_time == 0) { + /* Wake up in 10 seconds to check if value has changed */ set_timespec(abstime, 10); continue; } /* Set new time to wake up */ - set_timespec(abstime, ndb_cache_check_time); + struct timeval tv; + gettimeofday(&tv,0); + abstime.tv_sec= tv.tv_sec + (ndb_cache_check_time / 1000); + abstime.tv_nsec= tv.tv_usec * 1000 + (ndb_cache_check_time % 1000); + if (abstime.tv_nsec >= 1000000000) + { + abstime.tv_sec += 1; + abstime.tv_nsec -= 1000000000; + } /* Lock mutex and fill list with pointers to all open tables */ NDB_SHARE *share; |