Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
eef468e3
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
eef468e3
编写于
6月 18, 2005
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add better documentation on how id_function() should be defined and what
issues there are. PR: 1096
上级
4bd46774
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
13 deletion
+21
-13
doc/crypto/threads.pod
doc/crypto/threads.pod
+21
-13
未找到文件。
doc/crypto/threads.pod
浏览文件 @
eef468e3
...
...
@@ -65,18 +65,10 @@ B<CRYPTO_LOCK>, and releases it otherwise.
B<file> and B<line> are the file number of the function setting the
lock. They can be useful for debugging.
id_function(void) is a function that returns a thread ID, for
instance, pthread_self(). It is not, needed on Windows nor on
platforms where getpid() returns a different ID for each thread.
However, even on those platforms, pthread_self() should be used, since
the behavior of getpid() may depend on the machine where the program
is being run, not the machine where the program is being compiled.
(For instance, Red Hat 8 Linux and earlier used LinuxThreads, whose
getpid() returns a different value for each thread; Red Hat 9 Linux
and later use NPTL, which is Posix-conformant, and thus whose getpid()
returns the same value for all threads in a process. But a program
compiled on Red Hat 8 and run on Red Hat 9 will by default see
getpid() returning the same value for all threads.)
id_function(void) is a function that returns a thread ID, for example
pthread_self() if it returns an integer (see NOTES below). It isn't
needed on Windows nor on platforms where getpid() returns a different
ID for each thread (see NOTES below).
Additionally, OpenSSL supports dynamic locks, and sometimes, some parts
of OpenSSL need it for better performance. To enable this, the following
...
...
@@ -133,7 +125,7 @@ CRYPTO_get_new_dynlockid() returns the index to the newly created lock.
The other functions return no values.
=head1 NOTE
=head1 NOTE
S
You can find out if OpenSSL was configured with thread support:
...
...
@@ -148,6 +140,22 @@ You can find out if OpenSSL was configured with thread support:
Also, dynamic locks are currently not used internally by OpenSSL, but
may do so in the future.
Defining id_function(void) has it's own issues. Generally speaking,
pthread_self() should be used, even on platforms where getpid() gives
different answers in each thread, since that may depend on the machine
the program is run on, not the machine where the program is being
compiled. For instance, Red Hat 8 Linux and earlier used
LinuxThreads, whose getpid() returns a different value for each
thread. Red Hat 9 Linux and later use NPTL, which is
Posix-conformant, and has a getpid() that returns the same value for
all threads in a process. A program compiled on Red Hat 8 and run on
Red Hat 9 will therefore see getpid() returning the same value for
all threads.
There is still the issue of platforms where pthread_self() returns
something other than an integer. This is a bit unusual, and this
manual has no cookbook solution for that case.
=head1 EXAMPLES
B<crypto/threads/mttest.c> shows examples of the callback functions on
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录