MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
os0thread.cc File Reference
#include "os0thread.h"
#include "srv0srv.h"
#include "os0sync.h"
Include dependency graph for os0thread.cc:

Go to the source code of this file.

Functions

UNIV_INTERN ibool os_thread_eq (os_thread_id_t a, os_thread_id_t b)
UNIV_INTERN ulint os_thread_pf (os_thread_id_t a)
UNIV_INTERN os_thread_id_t os_thread_get_curr_id (void)
UNIV_INTERN os_thread_t os_thread_create_func (os_thread_func_t func, void *arg, os_thread_id_t *thread_id)
UNIV_INTERN void os_thread_exit (void *exit_value)
UNIV_INTERN void os_thread_yield (void)
UNIV_INTERN void os_thread_sleep (ulint tm)

Detailed Description

The interface to the operating system thread control primitives

Created 9/8/1995 Heikki Tuuri

Definition in file os0thread.cc.

Function Documentation

UNIV_INTERN os_thread_t os_thread_create_func ( os_thread_func_t  func,
void *  arg,
os_thread_id_t thread_id 
)

Creates a new thread of execution. The execution starts from the function given. The start function takes a void* parameter and returns an ulint.

Returns
handle to the thread
Parameters
funcin: pointer to function from which to start
argin: argument to start function
thread_idout: id of the created thread, or NULL

Definition at line 108 of file os0thread.cc.

Here is the call graph for this function:

UNIV_INTERN ibool os_thread_eq ( os_thread_id_t  a,
os_thread_id_t  b 
)

Compares two thread ids for equality.

Returns
TRUE if equal
Parameters
ain: OS thread or thread id
bin: OS thread or thread id

Definition at line 44 of file os0thread.cc.

Here is the caller graph for this function:

UNIV_INTERN void os_thread_exit ( void *  exit_value)

Exits the current thread.

Parameters
exit_valuein: exit value; in Windows this void* is cast as a DWORD

Definition at line 192 of file os0thread.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN os_thread_id_t os_thread_get_curr_id ( void  )

Returns the thread identifier of current thread. Currently the thread identifier in Unix is the thread handle itself. Note that in HP-UX pthread_t is a struct of 3 fields.

Returns
current thread identifier

Definition at line 91 of file os0thread.cc.

Here is the caller graph for this function:

UNIV_INTERN ulint os_thread_pf ( os_thread_id_t  a)

Converts an OS thread id to a ulint. It is NOT guaranteed that the ulint is unique for the thread though!

Returns
thread identifier as a number
Parameters
ain: OS thread identifier

Definition at line 70 of file os0thread.cc.

Here is the caller graph for this function:

UNIV_INTERN void os_thread_sleep ( ulint  tm)

The thread sleeps at least the time given in microseconds.

Parameters
tmin: time in microseconds

Definition at line 243 of file os0thread.cc.

Here is the caller graph for this function:

UNIV_INTERN void os_thread_yield ( void  )

Advises the os to give up remainder of the thread's time slice.

Definition at line 222 of file os0thread.cc.

Here is the call graph for this function:

Here is the caller graph for this function: