comparison src/os/unix/freebsd/ngx_rfork_thread.h @ 3:34a521b1a148

nginx-0.0.1-2002-08-20-18:48:28 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 20 Aug 2002 14:48:28 +0000
parents
children a7e45c45a95c
comparison
equal deleted inserted replaced
2:ffffe1499bce 3:34a521b1a148
1 #ifndef _NGX_OS_THREAD_H_INCLUDED_
2 #define _NGX_OS_THREAD_H_INCLUDED_
3
4
5 typedef int ngx_os_tid_t;
6 typedef int ngx_tid_t;
7
8
9 extern char *ngx_stacks_start;
10 extern char *ngx_stacks_end;
11 extern size_t ngx_stack_size;
12
13
14 static inline ngx_tid_t ngx_gettid()
15 {
16 char *sp;
17
18 __asm__ ("mov %%esp,%0" : "=r" (sp));
19 return (sp > ngx_stacks_end) ? 0:
20 (sp - ngx_stacks_start) / ngx_stack_size + 1;
21 }
22
23
24 #endif /* _NGX_OS_THREAD_H_INCLUDED_ */