summaryrefslogtreecommitdiff
path: root/storage/innobase/include/sync0arr.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/sync0arr.h')
-rw-r--r--storage/innobase/include/sync0arr.h63
1 files changed, 28 insertions, 35 deletions
diff --git a/storage/innobase/include/sync0arr.h b/storage/innobase/include/sync0arr.h
index 6e931346238..56f9ff78c49 100644
--- a/storage/innobase/include/sync0arr.h
+++ b/storage/innobase/include/sync0arr.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -36,32 +36,6 @@ typedef struct sync_cell_struct sync_cell_t;
/** Synchronization wait array */
typedef struct sync_array_struct sync_array_t;
-/** Parameters for sync_array_create() @{ */
-#define SYNC_ARRAY_OS_MUTEX 1 /*!< protected by os_mutex_t */
-#define SYNC_ARRAY_MUTEX 2 /*!< protected by mutex_t */
-/* @} */
-
-/*******************************************************************//**
-Creates a synchronization wait array. It is protected by a mutex
-which is automatically reserved when the functions operating on it
-are called.
-@return own: created wait array */
-UNIV_INTERN
-sync_array_t*
-sync_array_create(
-/*==============*/
- ulint n_cells, /*!< in: number of cells in the array
- to create */
- ulint protection); /*!< in: either SYNC_ARRAY_OS_MUTEX or
- SYNC_ARRAY_MUTEX: determines the type
- of mutex protecting the data structure */
-/******************************************************************//**
-Frees the resources in a wait array. */
-UNIV_INTERN
-void
-sync_array_free(
-/*============*/
- sync_array_t* arr); /*!< in, own: sync wait array */
/******************************************************************//**
Reserves a wait array cell for waiting for an object.
The event of the cell is reset to nonsignalled state. */
@@ -99,9 +73,9 @@ sync_array_free_cell(
Note that one of the wait objects was signalled. */
UNIV_INTERN
void
-sync_array_object_signalled(
-/*========================*/
- sync_array_t* arr); /*!< in: wait array */
+sync_array_object_signalled(void);
+/*=============================*/
+
/**********************************************************************//**
If the wakeup algorithm does not work perfectly at semaphore relases,
this function will do the waking (see the comment in mutex_exit). This
@@ -132,11 +106,30 @@ sync_array_validate(
Prints info of the wait array. */
UNIV_INTERN
void
-sync_array_print_info(
+sync_array_print(
+/*=============*/
+ FILE* file); /*!< in: file where to print */
+
+/**********************************************************************//**
+Create the primary system wait array(s), they are protected by an OS mutex */
+UNIV_INTERN
+void
+sync_array_init(
+/*============*/
+ ulint n_threads); /*!< in: Number of slots to create */
+/**********************************************************************//**
+Close sync array wait sub-system. */
+UNIV_INTERN
+void
+sync_array_close(void);
/*==================*/
- FILE* file, /*!< in: file where to print */
- sync_array_t* arr); /*!< in: wait array */
+/**********************************************************************//**
+Get an instance of the sync wait array. */
+UNIV_INTERN
+sync_array_t*
+sync_array_get(void);
+/*================*/
#ifndef UNIV_NONINL
#include "sync0arr.ic"