diff options
author | unknown <monty@hundin.mysql.fi> | 2002-08-08 15:24:47 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-08-08 15:24:47 +0300 |
commit | 267b80834ad524c0d72976bc71e5b5bc9815ea1a (patch) | |
tree | e7f4a2013ed3d66e640f6574e62cb7e534a5d77f /innobase/os | |
parent | ca1875f54033c5ea067ec3ec07b00375de6975d7 (diff) | |
parent | 40d3c3901b0427eba76119730f46784f946990b3 (diff) | |
download | mariadb-git-267b80834ad524c0d72976bc71e5b5bc9815ea1a.tar.gz |
merge with 3.23.52
BitKeeper/etc/logging_ok:
auto-union
configure.in:
Auto merged
Docs/manual.texi:
Auto merged
include/my_pthread.h:
Auto merged
include/mysql_com.h:
Auto merged
include/mysql_version.h.in:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/btr/btr0sea.c:
Auto merged
innobase/buf/buf0buf.c:
Auto merged
innobase/buf/buf0lru.c:
Auto merged
innobase/configure.in:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/fil/fil0fil.c:
Auto merged
innobase/fsp/fsp0fsp.c:
Auto merged
innobase/include/buf0buf.ic:
Auto merged
innobase/include/dyn0dyn.ic:
Auto merged
innobase/include/ha0ha.ic:
Auto merged
innobase/include/sync0rw.ic:
Auto merged
innobase/include/univ.i:
Auto merged
innobase/lock/lock0lock.c:
Auto merged
innobase/log/log0log.c:
Auto merged
innobase/mem/mem0dbg.c:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/os/os0thread.c:
Auto merged
innobase/page/page0cur.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/sync/sync0arr.c:
Auto merged
innobase/sync/sync0rw.c:
Auto merged
innobase/sync/sync0sync.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
myisam/mi_create.c:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/lex.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
strings/Makefile.am:
Auto merged
support-files/mysql.server.sh:
Auto merged
include/my_base.h:
merge with 3.23.52 (use local file)
include/sslopt-usage.h:
merge with 3.23.52 (use local file)
myisam/mi_search.c:
merge with 3.23.52 (use local file)
myisam/mi_write.c:
merge with 3.23.52 (use local file)
mysql-test/r/group_by.result:
merge with 3.23.52
(Need to be fixed before push)
mysys/my_pthread.c:
merge with 3.23.52 (use local file)
sql/gen_lex_hash.cc:
merge with 3.23.52 (use local file)
sql/ha_innodb.cc:
Total hand-merge with 3.23.52
sql/sql_yacc.yy:
merge with 3.23.52 (use local file)
support-files/mysql.spec.sh:
merge with 3.23.52 (use local file)
Diffstat (limited to 'innobase/os')
-rw-r--r-- | innobase/os/os0file.c | 19 | ||||
-rw-r--r-- | innobase/os/os0thread.c | 76 |
2 files changed, 67 insertions, 28 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index ae3c8a45f62..3ca0fbd68a4 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -22,7 +22,7 @@ Created 10/21/1995 Heikki Tuuri #endif -/* This specifies the file permissions InnoDB uses when it craetes files in +/* This specifies the file permissions InnoDB uses when it creates files in Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to my_umask */ @@ -2483,7 +2483,7 @@ loop: buf += sprintf(buf, "\n"); current_time = time(NULL); - time_elapsed = difftime(current_time, os_last_printout); + time_elapsed = 0.001 + difftime(current_time, os_last_printout); buf += sprintf(buf, "Pending flushes (fsync) log: %lu; buffer pool: %lu\n", @@ -2518,6 +2518,21 @@ loop: } /************************************************************************** +Refreshes the statistics used to print per-second averages. */ + +void +os_aio_refresh_stats(void) +/*======================*/ +{ + os_n_file_reads_old = os_n_file_reads; + os_n_file_writes_old = os_n_file_writes; + os_n_fsyncs_old = os_n_fsyncs; + os_bytes_read_since_printout = 0; + + os_last_printout = time(NULL); +} + +/************************************************************************** Checks that all slots in the system have been freed, that is, there are no pending io operations. */ diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c index 49d4c8518fb..a8b417f4f3a 100644 --- a/innobase/os/os0thread.c +++ b/innobase/os/os0thread.c @@ -18,26 +18,63 @@ Created 9/8/1995 Heikki Tuuri #include "srv0srv.h" +/******************************************************************* +Compares two threads or thread ids for equality */ + +ibool +os_thread_eq( +/*=========*/ + /* out: TRUE if equal */ + os_thread_t a, /* in: OS thread or thread id */ + os_thread_t b) /* in: OS thread or thread id */ +{ +#ifdef __WIN__ + if (a == b) { + return(TRUE); + } + + return(FALSE); +#else + if (pthread_equal(a, b)) { + return(TRUE); + } + + return(FALSE); +#endif +} + +/******************************************************************** +Converts an OS thread or thread id to a ulint. It is NOT guaranteed that +the ulint is unique for the thread though! */ + +ulint +os_thread_pf( +/*=========*/ + os_thread_t a) +{ +#ifdef UNIV_HPUX + /* In HP-UX a pthread_t is a struct of 3 fields: field1, field2, + field3. We do not know if field1 determines the thread uniquely. */ + + return((ulint)(a.field1)); +#else + return((ulint)a); +#endif +} + /********************************************************************* -Returns the thread identifier of current thread. */ +Returns the thread identifier of current thread. Currently the thread +identifier is the thread handle itself. Note that in HP-UX pthread_t is +a struct of 3 fields. */ os_thread_id_t os_thread_get_curr_id(void) /*=======================*/ { #ifdef __WIN__ - return(GetCurrentThreadId()); + return(GetCurrentThread()); #else - pthread_t pthr; - - pthr = pthread_self(); - - /* TODO: in the future we have to change os_thread_id - to pthread_t; the following cast may work in a wrong way on some - systems if pthread_t is a struct; this is just a quick fix - for HP-UX to eliminate a compiler warning */ - - return(*(os_thread_id_t*)((void*) (&pthr))); + return(pthread_self()); #endif } @@ -71,7 +108,6 @@ os_thread_create( arg, 0, /* thread runs immediately */ thread_id); - ut_a(thread); if (srv_set_thread_priorities) { @@ -108,7 +144,7 @@ Returns handle to the current thread. */ os_thread_t os_thread_get_curr(void) -/*=======================*/ +/*====================*/ { #ifdef __WIN__ return(GetCurrentThread()); @@ -116,18 +152,6 @@ os_thread_get_curr(void) return(pthread_self()); #endif } - -/********************************************************************* -Converts a thread id to a ulint. */ - -ulint -os_thread_conv_id_to_ulint( -/*=======================*/ - /* out: converted to ulint */ - os_thread_id_t id) /* in: thread id */ -{ - return((ulint)id); -} /********************************************************************* Advises the os to give up remainder of the thread's time slice. */ |