Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e6fb3e35
Commit
e6fb3e35
authored
May 17, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: Remove unused module sync0ipm
parent
521c1983
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
472 deletions
+4
-472
innobase/include/Makefile.am
innobase/include/Makefile.am
+1
-1
innobase/include/sync0ipm.h
innobase/include/sync0ipm.h
+0
-113
innobase/include/sync0ipm.ic
innobase/include/sync0ipm.ic
+0
-182
innobase/sync/Makefile.am
innobase/sync/Makefile.am
+1
-1
innobase/sync/makefilewin
innobase/sync/makefilewin
+2
-5
innobase/sync/sync0ipm.c
innobase/sync/sync0ipm.c
+0
-170
No files found.
innobase/include/Makefile.am
View file @
e6fb3e35
...
...
@@ -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 sync0
ipm.h sync0ipm.ic sync0
rw.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
\
...
...
innobase/include/sync0ipm.h
deleted
100644 → 0
View file @
521c1983
/******************************************************
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
innobase/include/sync0ipm.ic
deleted
100644 → 0
View file @
521c1983
/******************************************************
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, IB__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, IB__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);
}
}
innobase/sync/Makefile.am
View file @
e6fb3e35
...
...
@@ -19,6 +19,6 @@ include ../include/Makefile.i
noinst_LIBRARIES
=
libsync.a
libsync_a_SOURCES
=
sync0arr.c sync0
ipm.c sync0
rw.c sync0sync.c
libsync_a_SOURCES
=
sync0arr.c sync0rw.c sync0sync.c
EXTRA_PROGRAMS
=
innobase/sync/makefilewin
View file @
e6fb3e35
include ..\include\makefile.i
sync.lib: sync0sync.obj sync0rw.obj sync0
ipm.obj sync0
arr.obj
lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0
ipm.obj sync0
arr.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
innobase/sync/sync0ipm.c
deleted
100644 → 0
View file @
521c1983
/******************************************************
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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment