diff options
author | Igor Sysoev <igor@sysoev.ru> | 2002-08-20 14:48:28 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2002-08-20 14:48:28 +0000 |
commit | 2b54238a5f2edcca568c0676a779ef79ba152c91 (patch) | |
tree | 2cb7eb660e691eaab2c4f031adf881b7c88bffc9 /src/os/unix/freebsd/ngx_rfork_thread.h | |
parent | e0af1b89dcd100462a3195534b2f78a838ca85b5 (diff) | |
download | nginx-2b54238a5f2edcca568c0676a779ef79ba152c91.tar.gz nginx-2b54238a5f2edcca568c0676a779ef79ba152c91.zip |
nginx-0.0.1-2002-08-20-18:48:28 import
Diffstat (limited to 'src/os/unix/freebsd/ngx_rfork_thread.h')
-rw-r--r-- | src/os/unix/freebsd/ngx_rfork_thread.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/os/unix/freebsd/ngx_rfork_thread.h b/src/os/unix/freebsd/ngx_rfork_thread.h new file mode 100644 index 000000000..bd500e1a4 --- /dev/null +++ b/src/os/unix/freebsd/ngx_rfork_thread.h @@ -0,0 +1,24 @@ +#ifndef _NGX_OS_THREAD_H_INCLUDED_ +#define _NGX_OS_THREAD_H_INCLUDED_ + + +typedef int ngx_os_tid_t; +typedef int ngx_tid_t; + + +extern char *ngx_stacks_start; +extern char *ngx_stacks_end; +extern size_t ngx_stack_size; + + +static inline ngx_tid_t ngx_gettid() +{ + char *sp; + + __asm__ ("mov %%esp,%0" : "=r" (sp)); + return (sp > ngx_stacks_end) ? 0: + (sp - ngx_stacks_start) / ngx_stack_size + 1; +} + + +#endif /* _NGX_OS_THREAD_H_INCLUDED_ */ |