28 #include "os0thread.ic"
35 #ifndef UNIV_HOTBACKUP
56 if (pthread_equal(a, b)) {
78 return((ulint)(a.field1));
95 return(GetCurrentThreadId());
97 return(pthread_self());
110 os_thread_func_t func,
125 thread = CreateThread(NULL,
133 *thread_id = win_thread_id;
143 pthread_attr_init(&attr);
152 ret = pthread_attr_setstacksize(&attr,
153 (
size_t)(PTHREAD_STACK_MIN
157 "InnoDB: Error: pthread_attr_setstacksize"
158 " returned %d\n", ret);
167 ret = pthread_create(&pthread, pthread_attr_default, func, arg);
169 ret = pthread_create(&pthread, &attr, func, arg);
173 "InnoDB: Error: pthread_create returned %d\n", ret);
178 pthread_attr_destroy(&attr);
181 *thread_id = pthread;
197 #ifdef UNIV_DEBUG_THREAD_CREATION
198 fprintf(stderr,
"Thread exits, id %lu\n",
202 #ifdef UNIV_PFS_THREAD
211 ExitThread((DWORD) exit_value);
213 pthread_detach(pthread_self());
214 pthread_exit(exit_value);
227 #elif (defined(HAVE_SCHED_YIELD) && defined(HAVE_SCHED_H))
229 #elif defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
231 #elif defined(HAVE_PTHREAD_YIELD_ONE_ARG)
248 Sleep((DWORD) tm / 1000);
252 t.tv_sec = tm / 1000000;
253 t.tv_usec = tm % 1000000;
255 select(0, NULL, NULL, NULL, &t);