59
59
a wait array cell. In the debug version this function checks
60
60
if the wait for a semaphore will result in a deadlock, in which
61
61
case prints info and asserts. */
64
64
sync_array_wait_event(
65
65
/*==================*/
66
66
sync_array_t* arr, /* in: wait array */
67
67
ulint index); /* in: index of the reserved cell */
68
68
/**********************************************************************
69
Frees the cell. NOTE! sync_array_wait_event frees the cell
69
Frees the cell safely by reserving the sync array mutex and decrementing
70
n_reserved if necessary. Should only be called from mutex_spin_wait. */
73
sync_array_free_cell_protected(
74
/*===========================*/
75
75
sync_array_t* arr, /* in: wait array */
76
76
ulint index); /* in: index of the cell in array */
77
77
/**************************************************************************
78
Note that one of the wait objects was signalled. */
78
Looks for the cells in the wait array which refer
79
to the wait object specified,
80
and sets their corresponding events to the signaled state. In this
81
way releases the threads waiting for the object to contend for the object.
82
It is possible that no such cell is found, in which case does nothing. */
81
sync_array_object_signalled(
82
/*========================*/
83
sync_array_t* arr); /* in: wait array */
85
sync_array_signal_object(
86
/*=====================*/
87
sync_array_t* arr, /* in: wait array */
88
void* object);/* in: wait object */
84
89
/**************************************************************************
85
90
If the wakeup algorithm does not work perfectly at semaphore relases,
86
91
this function will do the waking (see the comment in mutex_exit). This
87
92
function should be called about every 1 second in the server. */
90
95
sync_arr_wake_threads_if_sema_free(void);
91
96
/*====================================*/
92
97
/**************************************************************************
93
98
Prints warnings of long semaphore waits to stderr. */
96
101
sync_array_print_long_waits(void);
97
102
/*=============================*/
100
105
/************************************************************************
101
106
Validates the integrity of the wait array. Checks
102
107
that the number of reserved cells equals the count variable. */
105
110
sync_array_validate(
106
111
/*================*/
107
112
sync_array_t* arr); /* in: sync wait array */
108
113
/**************************************************************************
109
114
Prints info of the wait array. */
112
117
sync_array_print_info(
113
118
/*==================*/