diff options
author | unknown <sergefp@mysql.com> | 2004-05-24 21:13:38 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2004-05-24 21:13:38 +0400 |
commit | c54f3ba680f6a1fe74e937dfe7b14da04220cba3 (patch) | |
tree | 5d63ab734c1fdc0e1db222f30ea63c47fae38c8c /innobase | |
parent | fbfdcf22f49eacc4a90fb6169dbbecb36d8e8b68 (diff) | |
parent | 88da3ae5f9e69a3bf6ced379908d01da5b3bfbb0 (diff) | |
download | mariadb-git-c54f3ba680f6a1fe74e937dfe7b14da04220cba3.tar.gz |
Merge
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/sql_lex.h:
SCCS merged
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/Makefile.am | 4 | ||||
-rw-r--r-- | innobase/include/data0data.ic | 2 | ||||
-rw-r--r-- | innobase/include/mem0pool.h | 2 | ||||
-rw-r--r-- | innobase/include/os0shm.h | 66 | ||||
-rw-r--r-- | innobase/include/os0shm.ic | 10 | ||||
-rw-r--r-- | innobase/include/sync0ipm.h | 113 | ||||
-rw-r--r-- | innobase/include/sync0ipm.ic | 182 | ||||
-rw-r--r-- | innobase/mem/mem0pool.c | 18 | ||||
-rw-r--r-- | innobase/os/Makefile.am | 2 | ||||
-rw-r--r-- | innobase/os/makefilewin | 7 | ||||
-rw-r--r-- | innobase/os/os0shm.c | 152 | ||||
-rw-r--r-- | innobase/pars/pars0lex.l | 4 | ||||
-rw-r--r-- | innobase/srv/srv0srv.c | 8 | ||||
-rw-r--r-- | innobase/sync/Makefile.am | 2 | ||||
-rw-r--r-- | innobase/sync/makefilewin | 7 | ||||
-rw-r--r-- | innobase/sync/sync0ipm.c | 170 | ||||
-rw-r--r-- | innobase/trx/trx0sys.c | 2 |
17 files changed, 17 insertions, 734 deletions
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am index 2584357e24a..102d25566da 100644 --- a/innobase/include/Makefile.am +++ b/innobase/include/Makefile.am @@ -32,7 +32,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \ mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \ mtr0types.h os0file.h os0proc.h os0proc.ic \ - os0shm.h os0shm.ic os0sync.h os0sync.ic os0thread.h \ + os0sync.h os0sync.ic os0thread.h \ os0thread.ic page0cur.h page0cur.ic page0page.h \ page0page.ic page0types.h pars0grm.h pars0opt.h \ pars0opt.ic pars0pars.h pars0pars.ic pars0sym.h \ @@ -44,7 +44,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \ row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \ row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \ - sync0arr.h sync0arr.ic sync0ipm.h sync0ipm.ic sync0rw.h \ + sync0arr.h sync0arr.ic sync0rw.h \ sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \ diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic index 569bf898801..0769372e16f 100644 --- a/innobase/include/data0data.ic +++ b/innobase/include/data0data.ic @@ -98,7 +98,7 @@ dfield_set_data( { ut_ad(field); - field->data = data; + field->data = (void*) data; field->len = len; } diff --git a/innobase/include/mem0pool.h b/innobase/include/mem0pool.h index 08327d95d37..95cf19676fb 100644 --- a/innobase/include/mem0pool.h +++ b/innobase/include/mem0pool.h @@ -19,8 +19,6 @@ typedef struct mem_pool_struct mem_pool_t; /* The common memory pool */ extern mem_pool_t* mem_comm_pool; -extern ulint mem_out_of_mem_err_msg_count; - /* Memory area header */ struct mem_area_struct{ diff --git a/innobase/include/os0shm.h b/innobase/include/os0shm.h deleted file mode 100644 index 250794a976f..00000000000 --- a/innobase/include/os0shm.h +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - -#ifndef os0shm_h -#define os0shm_h - -#include "univ.i" - -typedef void* os_shm_t; - - -/******************************************************************** -Creates an area of shared memory. It can be named so that -different processes may access it in the same computer. -If an area with the same name already exists, returns -a handle to that area (where the size of the area is -not changed even if this call requests a different size). -To use the area, it first has to be mapped to the process -address space by os_shm_map. */ - -os_shm_t -os_shm_create( -/*==========*/ - /* out, own: handle to the shared - memory area, NULL if error */ - ulint size, /* in: area size < 4 GB */ - char* name); /* in: name of the area as a null-terminated - string */ -/*************************************************************************** -Frees a shared memory area. The area can be freed only after it -has been unmapped in all the processes where it was mapped. */ - -ibool -os_shm_free( -/*========*/ - /* out: TRUE if success */ - os_shm_t shm); /* in, own: handle to a shared memory area */ -/*************************************************************************** -Maps a shared memory area in the address space of a process. */ - -void* -os_shm_map( -/*=======*/ - /* out: address of the area, NULL if error */ - os_shm_t shm); /* in: handle to a shared memory area */ -/*************************************************************************** -Unmaps a shared memory area from the address space of a process. */ - -ibool -os_shm_unmap( -/*=========*/ - /* out: TRUE if succeed */ - void* addr); /* in: address of the area */ - - -#ifndef UNIV_NONINL -#include "os0shm.ic" -#endif - -#endif diff --git a/innobase/include/os0shm.ic b/innobase/include/os0shm.ic deleted file mode 100644 index cc267544bc9..00000000000 --- a/innobase/include/os0shm.ic +++ /dev/null @@ -1,10 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - - diff --git a/innobase/include/sync0ipm.h b/innobase/include/sync0ipm.h deleted file mode 100644 index 3244a6d26de..00000000000 --- a/innobase/include/sync0ipm.h +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip mutex also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ - -#ifndef sync0ipm_h -#define sync0ipm_h - -#include "univ.i" -#include "os0sync.h" -#include "sync0sync.h" - -typedef struct ip_mutex_hdl_struct ip_mutex_hdl_t; -typedef struct ip_mutex_struct ip_mutex_t; - -/* NOTE! The structure appears here only for the compiler to -know its size. Do not use its fields directly! -The structure used in a fast implementation of -an interprocess mutex. */ - -struct ip_mutex_struct { - mutex_t mutex; /* Ordinary mutex struct */ - ulint waiters; /* This field is set to 1 if - there may be waiters */ -}; - -/* The performance of the ip mutex in NT depends on how often -a thread has to suspend itself waiting for the ip mutex -to become free. The following variable counts system calls -involved. */ - -extern ulint ip_mutex_system_call_count; - -/********************************************************************** -Creates, or rather, initializes -an ip mutex object in a specified shared memory location (which must be -appropriately aligned). The ip mutex is initialized in the reset state. -NOTE! Explicit destroying of the ip mutex with ip_mutex_free -is not recommended -as the mutex resides in shared memory and we cannot make sure that -no process is currently accessing it. Therefore just use -ip_mutex_close to free the operating system event and mutex. */ - -ulint -ip_mutex_create( -/*============*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle); /* out, own: handle to the - created mutex; handle exists - in the private address space of - the calling process */ -/********************************************************************** -NOTE! Using this function is not recommended. See the note -on ip_mutex_create. Destroys an ip mutex */ - -void -ip_mutex_free( -/*==========*/ - ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */ -/********************************************************************** -Opens an ip mutex object in a specified shared memory location. -Explicit closing of the ip mutex with ip_mutex_close is necessary to -free the operating system event and mutex created, and the handle. */ - -ulint -ip_mutex_open( -/*==========*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle); /* out, own: handle to the - opened mutex */ -/********************************************************************** -Closes an ip mutex. */ - -void -ip_mutex_close( -/*===========*/ - ip_mutex_hdl_t* handle); /* in, own: ip mutex handle */ -/****************************************************************** -Reserves an ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_enter( -/*===========*/ - /* out: 0 if success, - SYNC_TIME_EXCEEDED if timeout */ - ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */ - ulint time); /* in: maximum time to wait, in - microseconds, or - SYNC_INFINITE_TIME */ -/****************************************************************** -Releases an ip mutex. */ -UNIV_INLINE -void -ip_mutex_exit( -/*==========*/ - ip_mutex_hdl_t* ip_mutex_hdl); /* in: pointer to ip mutex handle */ - - - -#ifndef UNIV_NONINL -#include "sync0ipm.ic" -#endif - -#endif diff --git a/innobase/include/sync0ipm.ic b/innobase/include/sync0ipm.ic deleted file mode 100644 index 126aceae1eb..00000000000 --- a/innobase/include/sync0ipm.ic +++ /dev/null @@ -1,182 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip_mutex_t also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ - -/* An extra structure created in the private address space of each process -which creates or opens the ip mutex. */ - -struct ip_mutex_hdl_struct { - ip_mutex_t* ip_mutex; /* pointer to ip mutex */ - os_event_t released; /* event which signals that the mutex - is released; this is obtained from - create or open of an ip mutex */ - os_mutex_t exclude; /* os mutex obtained when ip mutex is - created or opened */ -}; - - -UNIV_INLINE -ulint -ip_mutex_get_waiters( -volatile ip_mutex_t* ipm); -UNIV_INLINE -void -ip_mutex_set_waiters( -volatile ip_mutex_t* ipm, - ulint flag); -UNIV_INLINE -mutex_t* -ip_mutex_get_mutex( - ip_mutex_t* ipm); - - -/****************************************************************** -Accessor functions for ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_get_waiters( -volatile ip_mutex_t* ipm) -{ - return(ipm->waiters); -} -UNIV_INLINE -void -ip_mutex_set_waiters( -volatile ip_mutex_t* ipm, - ulint flag) -{ - ipm->waiters = flag; -} -UNIV_INLINE -mutex_t* -ip_mutex_get_mutex( - ip_mutex_t* ipm) -{ - return(&(ipm->mutex)); -} - -/****************************************************************** -Reserves an ip mutex. */ -UNIV_INLINE -ulint -ip_mutex_enter( -/*===========*/ - /* out: 0 if success, - SYNC_TIME_EXCEEDED if timeout */ - ip_mutex_hdl_t* ip_mutex_hdl, /* in: pointer to ip mutex handle */ - ulint time) /* in: maximum time to wait, in - microseconds, or - SYNC_INFINITE_TIME */ -{ - mutex_t* mutex; - os_event_t released; - os_mutex_t exclude; - ip_mutex_t* ip_mutex; - ulint loop_count; - ulint ret; - - ip_mutex = ip_mutex_hdl->ip_mutex; - released = ip_mutex_hdl->released; - exclude = ip_mutex_hdl->exclude; - - mutex = ip_mutex_get_mutex(ip_mutex); - - loop_count = 0; -loop: - loop_count++; - ut_ad(loop_count < 15); - - if (mutex_enter_nowait(mutex, __FILE__, __LINE__) == 0) { - /* Succeeded! */ - - return(0); - } - - ip_mutex_system_call_count++; - - os_event_reset(released); - - /* Order is important here: FIRST reset event, then set waiters */ - ip_mutex_set_waiters(ip_mutex, 1); - - if (mutex_enter_nowait(mutex, __FILE__, __LINE__) == 0) { - /* Succeeded! */ - - return(0); - } - - if (time == SYNC_INFINITE_TIME) { - time = OS_SYNC_INFINITE_TIME; - } - - /* Suspend to wait for release */ - - ip_mutex_system_call_count++; - - ret = os_event_wait_time(released, time); - - ip_mutex_system_call_count++; - - os_mutex_enter(exclude); - ip_mutex_system_call_count++; - os_mutex_exit(exclude); - - if (ret != 0) { - ut_a(ret == OS_SYNC_TIME_EXCEEDED); - - return(SYNC_TIME_EXCEEDED); - } - - goto loop; -} - -/****************************************************************** -Releases an ip mutex. */ -UNIV_INLINE -void -ip_mutex_exit( -/*==========*/ - ip_mutex_hdl_t* ip_mutex_hdl) /* in: pointer to ip mutex handle */ -{ - mutex_t* mutex; - os_event_t released; - os_mutex_t exclude; - ip_mutex_t* ip_mutex; - - ip_mutex = ip_mutex_hdl->ip_mutex; - released = ip_mutex_hdl->released; - exclude = ip_mutex_hdl->exclude; - - mutex = ip_mutex_get_mutex(ip_mutex); - - mutex_exit(mutex); - - if (ip_mutex_get_waiters(ip_mutex) != 0) { - - ip_mutex_set_waiters(ip_mutex, 0); - - /* Order is important here: FIRST reset waiters, - then set event */ - - ip_mutex_system_call_count++; - os_mutex_enter(exclude); - - /* The use of the exclude mutex seems to prevent some - kind of a convoy problem in the test tsproc.c. We do - not know why. */ - - ip_mutex_system_call_count++; - - os_event_set(released); - - ip_mutex_system_call_count++; - - os_mutex_exit(exclude); - } -} diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index 7f36b37f734..0227c2d0969 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -97,8 +97,6 @@ struct mem_pool_struct{ /* The common memory pool */ mem_pool_t* mem_comm_pool = NULL; -ulint mem_out_of_mem_err_msg_count = 0; - /* We use this counter to check that the mem pool mutex does not leak; this is to track a strange assertion failure reported at mysql@lists.mysql.com */ @@ -266,8 +264,6 @@ mem_pool_fill_free_list( if (i >= 63) { /* We come here when we have run out of space in the memory pool: */ - - mem_out_of_mem_err_msg_count++; return(FALSE); } @@ -461,17 +457,13 @@ mem_area_free( ulint size; ulint n; - if (mem_out_of_mem_err_msg_count > 0) { - /* It may be that the area was really allocated from the - OS with regular malloc: check if ptr points within - our memory pool */ + /* It may be that the area was really allocated from the OS with + regular malloc: check if ptr points within our memory pool */ - if ((byte*)ptr < pool->buf - || (byte*)ptr >= pool->buf + pool->size) { - ut_free(ptr); + if ((byte*)ptr < pool->buf || (byte*)ptr >= pool->buf + pool->size) { + ut_free(ptr); - return; - } + return; } area = (mem_area_t*) (((byte*)ptr) - MEM_AREA_EXTRA_SIZE); diff --git a/innobase/os/Makefile.am b/innobase/os/Makefile.am index 132ce07c83b..3b09a10efb5 100644 --- a/innobase/os/Makefile.am +++ b/innobase/os/Makefile.am @@ -19,7 +19,7 @@ include ../include/Makefile.i noinst_LIBRARIES = libos.a -libos_a_SOURCES = os0proc.c os0shm.c os0sync.c os0thread.c os0file.c +libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c EXTRA_PROGRAMS = diff --git a/innobase/os/makefilewin b/innobase/os/makefilewin index 08dba0e5e47..8bc8d08611b 100644 --- a/innobase/os/makefilewin +++ b/innobase/os/makefilewin @@ -1,7 +1,7 @@ include ..\include\makefile.i -os.lib: os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj - lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0shm.obj os0proc.obj os0file.obj +os.lib: os0sync.obj os0thread.obj os0proc.obj os0file.obj + lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0proc.obj os0file.obj os0sync.obj: os0sync.c $(CCOM) $(CFLW) -c os0sync.c @@ -9,9 +9,6 @@ os0sync.obj: os0sync.c os0thread.obj: os0thread.c $(CCOM) $(CFLW) -c os0thread.c -os0shm.obj: os0shm.c - $(CCOM) $(CFLW) -c os0shm.c - os0proc.obj: os0proc.c $(CCOM) $(CFLW) -c os0proc.c diff --git a/innobase/os/os0shm.c b/innobase/os/os0shm.c deleted file mode 100644 index f49aa2922b0..00000000000 --- a/innobase/os/os0shm.c +++ /dev/null @@ -1,152 +0,0 @@ -/****************************************************** -The interface to the operating system -shared memory primitives - -(c) 1995 Innobase Oy - -Created 9/23/1995 Heikki Tuuri -*******************************************************/ - -#include "os0shm.h" -#ifdef UNIV_NONINL -#include "os0shm.ic" -#endif - -#ifdef __WIN__ -#include "windows.h" - -typedef HANDLE os_shm_t; -#endif - -/******************************************************************** -Creates an area of shared memory. It can be named so that -different processes may access it in the same computer. -If an area with the same name already exists, returns -a handle to that area (where the size of the area is -not changed even if this call requests a different size). -To use the area, it first has to be mapped to the process -address space by os_shm_map. */ - -os_shm_t -os_shm_create( -/*==========*/ - /* out, own: handle to the shared - memory area, NULL if error */ - ulint size, /* in: area size < 4 GB */ - char* name) /* in: name of the area as a null-terminated - string */ -{ -#ifdef __WIN__ - os_shm_t shm; - - ut_a(name); - ut_a(size > 0); - ut_a(size < 0xFFFFFFFF); - - /* In Windows NT shared memory is created as a memory mapped - file */ - shm = CreateFileMapping((HANDLE)0xFFFFFFFF, /* use operating system - swap file as the backing - file */ - NULL, /* default security - descriptor */ - PAGE_READWRITE, /* allow reading and - writing */ - 0, /* size must be less - than 4 GB */ - (DWORD)size, - name); - return(shm); -#else - UT_NOT_USED(size); - UT_NOT_USED(name); - - return(NULL); -#endif -} - -/*************************************************************************** -Frees a shared memory area. The area can be freed only after it -has been unmapped in all the processes where it was mapped. */ - -ibool -os_shm_free( -/*========*/ - /* out: TRUE if success */ - os_shm_t shm) /* in, own: handle to a shared memory area */ -{ -#ifdef __WIN__ - - BOOL ret; - - ut_a(shm); - - ret = CloseHandle(shm); - - if (ret) { - return(TRUE); - } else { - return(FALSE); - } -#else - UT_NOT_USED(shm); - - return(FALSE); -#endif -} - -/*************************************************************************** -Maps a shared memory area in the address space of a process. */ - -void* -os_shm_map( -/*=======*/ - /* out: address of the area, NULL if error */ - os_shm_t shm) /* in: handle to a shared memory area */ -{ -#ifdef __WIN__ - void* mem; - - ut_a(shm); - - mem = MapViewOfFile(shm, - FILE_MAP_ALL_ACCESS, /* read and write access - allowed */ - 0, /* map from start of */ - 0, /* area */ - 0); /* map the whole area */ - return(mem); -#else - UT_NOT_USED(shm); - - return(NULL); -#endif -} - -/*************************************************************************** -Unmaps a shared memory area from the address space of a process. */ - -ibool -os_shm_unmap( -/*=========*/ - /* out: TRUE if succeed */ - void* addr) /* in: address of the area */ -{ -#ifdef __WIN__ - BOOL ret; - - ut_a(addr); - - ret = UnmapViewOfFile(addr); - - if (ret) { - return(TRUE); - } else { - return(FALSE); - } -#else - UT_NOT_USED(addr); - - return(FALSE); -#endif -} diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 7b65770b3da..0b1af554bed 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -123,7 +123,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* BEGIN(INITIAL); yylval = sym_tab_add_str_lit( pars_sym_tab_global, - stringbuf, stringbuf_len); + (byte*) stringbuf, stringbuf_len); return(PARS_STR_LIT); } } @@ -137,7 +137,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* "SQL" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, - yytext, yyleng); + (byte*) yytext, yyleng); return(PARS_SQL_TOKEN); } diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 7194dfc1d2f..c21dfda6265 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -32,7 +32,6 @@ Created 10/8/1995 Heikki Tuuri #include "mem0mem.h" #include "mem0pool.h" #include "sync0sync.h" -#include "sync0ipm.h" #include "thr0loc.h" #include "que0que.h" #include "srv0que.h" @@ -1525,13 +1524,6 @@ srv_printf_innodb_monitor( ut_total_allocated_memory, mem_pool_get_reserved(mem_comm_pool)); - if (mem_out_of_mem_err_msg_count > 0) { - fprintf(file, - "Mem allocation has spilled out of additional mem pool" ULINTPF - "times\n", - mem_out_of_mem_err_msg_count); - } - if (srv_use_awe) { fprintf(file, "In addition to that %lu MB of AWE memory allocated\n", diff --git a/innobase/sync/Makefile.am b/innobase/sync/Makefile.am index 4acd4516e35..c95955a733b 100644 --- a/innobase/sync/Makefile.am +++ b/innobase/sync/Makefile.am @@ -19,6 +19,6 @@ include ../include/Makefile.i noinst_LIBRARIES = libsync.a -libsync_a_SOURCES = sync0arr.c sync0ipm.c sync0rw.c sync0sync.c +libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c EXTRA_PROGRAMS = diff --git a/innobase/sync/makefilewin b/innobase/sync/makefilewin index 5809d8e7375..73cff40405a 100644 --- a/innobase/sync/makefilewin +++ b/innobase/sync/makefilewin @@ -1,7 +1,7 @@ include ..\include\makefile.i -sync.lib: sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj - lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0ipm.obj sync0arr.obj +sync.lib: sync0sync.obj sync0rw.obj sync0arr.obj + lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0arr.obj sync0sync.obj: sync0sync.c $(CCOM) $(CFLN) -c sync0sync.c @@ -9,9 +9,6 @@ sync0sync.obj: sync0sync.c sync0rw.obj: sync0rw.c $(CCOM) $(CFL) -c sync0rw.c -sync0ipm.obj: sync0ipm.c - $(CCOM) $(CFL) -c sync0ipm.c - sync0arr.obj: sync0arr.c $(CCOM) $(CFL) -c sync0arr.c diff --git a/innobase/sync/sync0ipm.c b/innobase/sync/sync0ipm.c deleted file mode 100644 index e10e1c85da5..00000000000 --- a/innobase/sync/sync0ipm.c +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************** -A fast mutex for interprocess synchronization. -mutex_t can be used only within single process, -but ip_mutex_t also between processes. - -(c) 1995 Innobase Oy - -Created 9/30/1995 Heikki Tuuri -*******************************************************/ -#include "sync0ipm.h" -#ifdef UNIV_NONINL -#include "sync0ipm.ic" -#endif - -#include "mem0mem.h" - -/* The performance of the ip mutex in NT depends on how often -a thread has to suspend itself waiting for the ip mutex -to become free. The following variable counts system calls -involved. */ - -ulint ip_mutex_system_call_count = 0; - -/********************************************************************** -Creates, or rather, initializes -an ip mutex object in a specified shared memory location (which must be -appropriately aligned). The ip mutex is initialized in the reset state. -NOTE! Explicit destroying of the ip mutex with ip_mutex_free -is not recommended -as the mutex resides in shared memory and we cannot make sure that -no process is currently accessing it. Therefore just use -ip_mutex_close to free the operating system event and mutex. */ - -ulint -ip_mutex_create( -/*============*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle) /* out, own: handle to the - created mutex; handle exists - in the private address space of - the calling process */ -{ - mutex_t* mutex; - char* buf; - os_event_t released; - os_mutex_t exclude; - - ip_mutex_set_waiters(ip_mutex, 0); - - buf = mem_alloc(strlen(name) + 20); - - strcpy(buf, name); - strcpy(buf + strlen(name), "_IB_RELS"); - - released = os_event_create(buf); - - if (released == NULL) { - mem_free(buf); - return(1); - } - - strcpy(buf + strlen(name), "_IB_EXCL"); - - exclude = os_mutex_create(buf); - - if (exclude == NULL) { - os_event_free(released); - mem_free(buf); - return(1); - } - - mutex = ip_mutex_get_mutex(ip_mutex); - - mutex_create(mutex); - mutex_set_level(mutex, SYNC_NO_ORDER_CHECK); - - *handle = mem_alloc(sizeof(ip_mutex_hdl_t)); - - (*handle)->ip_mutex = ip_mutex; - (*handle)->released = released; - (*handle)->exclude = exclude; - - mem_free(buf); - - return(0); -} - -/********************************************************************** -NOTE! Using this function is not recommended. See the note -on ip_mutex_create. Destroys an ip mutex */ - -void -ip_mutex_free( -/*==========*/ - ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */ -{ - mutex_free(ip_mutex_get_mutex(handle->ip_mutex)); - - os_event_free(handle->released); - os_mutex_free(handle->exclude); - - mem_free(handle); -} - -/********************************************************************** -Opens an ip mutex object in a specified shared memory location. -Explicit closing of the ip mutex with ip_mutex_close is necessary to -free the operating system event and mutex created, and the handle. */ - -ulint -ip_mutex_open( -/*==========*/ - /* out: 0 if succeed */ - ip_mutex_t* ip_mutex, /* in: pointer to shared memory */ - char* name, /* in: name of the ip mutex */ - ip_mutex_hdl_t** handle) /* out, own: handle to the - opened mutex */ -{ - char* buf; - os_event_t released; - os_mutex_t exclude; - - buf = mem_alloc(strlen(name) + 20); - - strcpy(buf, name); - strcpy(buf + strlen(name), "_IB_RELS"); - - released = os_event_create(buf); - - if (released == NULL) { - mem_free(buf); - return(1); - } - - strcpy(buf + strlen(name), "_IB_EXCL"); - - exclude = os_mutex_create(buf); - - if (exclude == NULL) { - os_event_free(released); - mem_free(buf); - return(1); - } - - *handle = mem_alloc(sizeof(ip_mutex_hdl_t)); - - (*handle)->ip_mutex = ip_mutex; - (*handle)->released = released; - (*handle)->exclude = exclude; - - mem_free(buf); - - return(0); -} - -/********************************************************************** -Closes an ip mutex. */ - -void -ip_mutex_close( -/*===========*/ - ip_mutex_hdl_t* handle) /* in, own: ip mutex handle */ -{ - os_event_free(handle->released); - os_mutex_free(handle->exclude); - - mem_free(handle); -} diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index 87abcbefa52..7e35e34f014 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -596,7 +596,7 @@ trx_sys_update_mysql_binlog_offset( MLOG_4BYTES, mtr); } - if (0 != strcmp(sys_header + field + TRX_SYS_MYSQL_LOG_NAME, file_name)) { + if (0 != strcmp((char*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME), file_name)) { mlog_write_string(sys_header + field + TRX_SYS_MYSQL_LOG_NAME, |