资源简介
posix linux环境下的pthread source 通过查看源代码可以对线程的认识更加深刻 你知道吗?线程的底层实现也是调用clone[创建进程] 故有线程是轻量级的进程
代码片段和文件信息
/* Copyright (C) 2002-2013 Free Software Foundation Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not see
. */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef NEED_SEPARATE_REGISTER_STACK
/* Most architectures have exactly one stack pointer. Some have more. */
# define STACK_VARIABLES void *stackaddr = NULL
/* How to pass the values to the ‘create_thread‘ function. */
# define STACK_VARIABLES_ARGS stackaddr
/* How to declare function which gets there parameters. */
# define STACK_VARIABLES_PARMS void *stackaddr
/* How to declare allocate_stack. */
# define ALLOCATE_STACK_PARMS void **stack
/* This is how the function is called. We do it this way to allow
other variants of the function to have more parameters. */
# define ALLOCATE_STACK(attr pd) allocate_stack (attr pd &stackaddr)
#else
/* We need two stacks. The kernel will place them but we have to tell
the kernel about the size of the reserved address space. */
# define STACK_VARIABLES void *stackaddr = NULL; size_t stacksize = 0
/* How to pass the values to the ‘create_thread‘ function. */
# define STACK_VARIABLES_ARGS stackaddr stacksize
/* How to declare function which gets there parameters. */
# define STACK_VARIABLES_PARMS void *stackaddr size_t stacksize
/* How to declare allocate_stack. */
# define ALLOCATE_STACK_PARMS void **stack size_t *stacksize
/* This is how the function is called. We do it this way to allow
other variants of the function to have more parameters. */
# define ALLOCATE_STACK(attr pd) \
allocate_stack (attr pd &stackaddr &stacksize)
#endif
/* Default alignment of stack. */
#ifndef STACK_ALIGN
# define STACK_ALIGN __alignof__ (long double)
#endif
/* Default value for minimal stack size after allocating thread
descriptor and guard. */
#ifndef MINIMAL_REST_STACK
# define MINIMAL_REST_STACK 4096
#endif
/* Newer kernels have the MAP_STACK flag to indica
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-11-14 18:44 nptl\
文件 2545 2013-11-14 16:43 nptl\ANNOUNCE
文件 54 2013-11-14 16:43 nptl\Banner
文件 520054 2013-11-14 16:43 nptl\ChangeLog
文件 982 2013-11-14 16:43 nptl\DESIGN-barrier.txt
文件 2235 2013-11-14 16:43 nptl\DESIGN-condvar.txt
文件 2731 2013-11-14 16:43 nptl\DESIGN-rwlock.txt
文件 835 2013-11-14 16:43 nptl\DESIGN-sem.txt
文件 3981 2013-11-14 16:43 nptl\DESIGN-systemtap-probes.txt
文件 1286 2013-11-14 16:43 nptl\Makeconfig
文件 24675 2013-11-14 16:43 nptl\Makefile
文件 1038 2013-11-14 16:43 nptl\TODO
文件 588 2013-11-14 16:43 nptl\TODO-kernel
文件 295 2013-11-14 16:43 nptl\TODO-testing
文件 8157 2013-11-14 16:43 nptl\Versions
文件 1450 2013-11-14 16:43 nptl\alloca_cutoff.c
文件 36671 2013-11-14 16:43 nptl\allocatestack.c
文件 2946 2013-11-14 16:43 nptl\cancellation.c
文件 1726 2013-11-14 16:43 nptl\cleanup.c
文件 1788 2013-11-14 16:43 nptl\cleanup_compat.c
文件 2950 2013-11-14 16:43 nptl\cleanup_defer.c
文件 3058 2013-11-14 16:43 nptl\cleanup_defer_compat.c
文件 1032 2013-11-14 16:43 nptl\cleanup_routine.c
文件 2153 2013-11-14 16:43 nptl\cond-perf.c
文件 399 2013-11-14 16:43 nptl\configure
文件 13281 2013-11-14 16:43 nptl\descr.h
文件 2179 2013-11-14 16:43 nptl\eintr.c
文件 13 2013-11-14 16:43 nptl\elision-conf.h
文件 31 2013-11-14 16:43 nptl\errno-loc.c
文件 1117 2013-11-14 16:43 nptl\events.c
文件 7923 2013-11-14 16:43 nptl\forward.c
............此处省略928个文件信息
- 上一篇:周传雄专辑,关不上的窗-MTV
- 下一篇:Axure后台业务模型2.0版
相关资源
- mqtt源码及文档
- 大学物理简明教程课后习题答案第三
- sourcer 7 dos下的反编译软件
- pthreads-w32-2-8-0-release.exe及编译方法
- source insight 主题monokia
- Applied.Cryptography.Protocols.Algorithms.and.
- source insight3.5汉化版
- Source Code Pro/微軟正黑整合體
- image segmentor source code and release 图像分
- SourceAnywhere 服务端
- Win32ASM Tutorial Resource Kit v1.00
- FastReport v6.3.11 Enterprise Full Source
- ZedBoard_OOB_Design(SD card image and source)
- FastReport Professtional 5.6.2 Full Source for
- Tmall-Source-master.zip
- ImageEn 5.2.0 D5 to Berlin Full Source
- Audio Source Separation and Speech Enhancement
- AMP SOURCE
- gitlab cookbook
- source insight 4.0养眼主题monokia
- 生产者-消费者进程实现Produce_Consume
- Leda42SourceCode
- Odin Inspector Source Code 2.1.4.unitypackage
- Open Source Fuzzing Tools
- dOPC for D6 ~ XE4 DXE10.2 Tokyo DXE10.3 RIO Fu
- XLSReadWriteII 6.00.47 For Delphi10.3 RIO Full
- SourceInsight教程及技巧大全最终整合版
- 安装ttf-mscorefonts-installer所需字体
- Statistical Multisource-Multitarget Informatio
-
Source Insight 4.0 仿SolarizedDark主题xm
评论
共有 条评论