1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#11766305 - 59392: Remove thr0loc.c and ibuf_inside() [part 3]

Remove the slot_no member of struct thr_local_struct.

enum srv_thread_type: Remove unused thread types.
srv_get_thread_type(): Unused function, remove.

thr_local_get_slot_no(), thr_local_set_slot_no(): Remove.

srv_thread_type_validate(), srv_slot_get_type(): New functions, for debugging.

srv_table_reserve_slot(): Return the srv_slot_t* directly. Do not create
thread-local storage.

srv_suspend_thread(): Get the srv_slot_t* as parameter. Return void;
the caller knows slot->event already.

srv_thread_has_reserved_slot(), srv_release_threads(): Assert
srv_thread_type_validate(type).

srv_init(): Use mem_zalloc() instead of mem_alloc(). Replace
srv_table_get_nth_slot(), because it now asserts that the kernel_mutex
is being held.

srv_master_thread(), srv_purge_thread(): Remember the slot from
srv_table_reserve_slot().

rb:629 approved by Inaam Rana
This commit is contained in:
Marko Mäkelä
2011-03-22 13:39:16 +02:00
parent 0cedc70904
commit a4d2a3a3b4
4 changed files with 74 additions and 176 deletions

View File

@ -442,16 +442,8 @@ typedef enum srv_stats_method_name_enum srv_stats_method_name_t;
#ifndef UNIV_HOTBACKUP
/** Types of threads existing in the system. */
enum srv_thread_type {
SRV_COM = 1, /**< threads serving communication and queries */
SRV_CONSOLE, /**< thread serving console */
SRV_WORKER, /**< threads serving parallelized queries and
SRV_WORKER = 0, /**< threads serving parallelized queries and
queries released from lock wait */
#if 0
/* Utility threads */
SRV_BUFFER, /**< thread flushing dirty buffer blocks */
SRV_RECOVERY, /**< threads finishing a recovery */
SRV_INSERT, /**< thread flushing the insert buffer to disk */
#endif
SRV_MASTER /**< the master thread, (whose type number must
be biggest) */
};
@ -490,13 +482,6 @@ ulint
srv_get_n_threads(void);
/*===================*/
/*********************************************************************//**
Returns the calling thread type.
@return SRV_COM, ... */
enum srv_thread_type
srv_get_thread_type(void);
/*=====================*/
/*********************************************************************//**
Check whether thread type has reserved a slot.
@return slot number or UNDEFINED if not found*/
UNIV_INTERN