Mercurial > hg > nginx-quic
comparison src/os/freebsd/ngx_os_thread.h @ 1:d220029ac7f3
nginx-0.0.1-2002-08-15-21:20:26 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 15 Aug 2002 17:20:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:4eff17414a43 | 1:d220029ac7f3 |
---|---|
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_ */ |