threads.3 (206048) | threads.3 (215698) |
---|---|
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 | 1.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) |
2.\" 3.\" Standard preamble: 4.\" ======================================================================== | 2.\" 3.\" Standard preamble: 4.\" ======================================================================== |
5.de Sh \" Subsection heading 6.br 7.if t .Sp 8.ne 5 9.PP 10\fB\\$1\fR 11.PP 12.. | |
13.de Sp \" Vertical space (when we can't use .PP) 14.if t .sp .5v 15.if n .sp 16.. 17.de Vb \" Begin verbatim text 18.ft CW 19.nf 20.ne \\$1 21.. 22.de Ve \" End verbatim text 23.ft R 24.fi 25.. 26.\" Set up some character translations and predefined strings. \*(-- will 27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | 5.de Sp \" Vertical space (when we can't use .PP) 6.if t .sp .5v 7.if n .sp 8.. 9.de Vb \" Begin verbatim text 10.ft CW 11.nf 12.ne \\$1 13.. 14.de Ve \" End verbatim text 15.ft R 16.fi 17.. 18.\" Set up some character translations and predefined strings. \*(-- will 19.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
28.\" double quote, and \*(R" will give a right double quote. | will give a 29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to 30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' 31.\" expand to `' in nroff, nothing in troff, for use with C<>. 32.tr \(*W-|\(bv\*(Tr | 20.\" double quote, and \*(R" will give a right double quote. \*(C+ will 21.\" give a nicer C++. Capital omega is used to do unbreakable dashes and 22.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, 23.\" nothing in troff, for use with C<>. 24.tr \(*W- |
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 34.ie n \{\ 35. ds -- \(*W- 36. ds PI pi 37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch 39. ds L" "" 40. ds R" "" 41. ds C` "" 42. ds C' "" 43'br\} 44.el\{\ 45. ds -- \|\(em\| 46. ds PI \(*p 47. ds L" `` 48. ds R" '' 49'br\} 50.\" | 25.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 26.ie n \{\ 27. ds -- \(*W- 28. ds PI pi 29. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 30. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch 31. ds L" "" 32. ds R" "" 33. ds C` "" 34. ds C' "" 35'br\} 36.el\{\ 37. ds -- \|\(em\| 38. ds PI \(*p 39. ds L" `` 40. ds R" '' 41'br\} 42.\" |
43.\" Escape single quotes in literal strings from groff's Unicode transform. 44.ie \n(.g .ds Aq \(aq 45.el .ds Aq ' 46.\" |
|
51.\" If the F register is turned on, we'll generate index entries on stderr for | 47.\" If the F register is turned on, we'll generate index entries on stderr for |
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | 48.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
53.\" entries marked with X<> in POD. Of course, you'll have to process the 54.\" output yourself in some meaningful fashion. | 49.\" entries marked with X<> in POD. Of course, you'll have to process the 50.\" output yourself in some meaningful fashion. |
55.if \nF \{\ | 51.ie \nF \{\ |
56. de IX 57. tm Index:\\$1\t\\n%\t"\\$2" 58.. 59. nr % 0 60. rr F 61.\} | 52. de IX 53. tm Index:\\$1\t\\n%\t"\\$2" 54.. 55. nr % 0 56. rr F 57.\} |
58.el \{\ 59. de IX 60.. 61.\} |
|
62.\" | 62.\" |
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes 64.\" way too many mistakes in technical documents. 65.hy 0 66.if n .na 67.\" | |
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 69.\" Fear. Run. Save yourself. No user-serviceable parts. 70. \" fudge factors for nroff and troff 71.if n \{\ 72. ds #H 0 73. ds #V .8m 74. ds #F .3m 75. ds #[ \f1 --- 48 unchanged lines hidden (view full) --- 124. ds Th \o'LP' 125. ds ae ae 126. ds Ae AE 127.\} 128.rm #[ #] #H #V #F C 129.\" ======================================================================== 130.\" 131.IX Title "threads 3" | 63.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 64.\" Fear. Run. Save yourself. No user-serviceable parts. 65. \" fudge factors for nroff and troff 66.if n \{\ 67. ds #H 0 68. ds #V .8m 69. ds #F .3m 70. ds #[ \f1 --- 48 unchanged lines hidden (view full) --- 119. ds Th \o'LP' 120. ds ae ae 121. ds Ae AE 122.\} 123.rm #[ #] #H #V #F C 124.\" ======================================================================== 125.\" 126.IX Title "threads 3" |
132.TH threads 3 "2010-03-24" "0.9.8n" "OpenSSL" | 127.TH threads 3 "2010-11-16" "0.9.8p" "OpenSSL" 128.\" For nroff, turn off justification. Always turn off hyphenation; it makes 129.\" way too many mistakes in technical documents. 130.if n .ad l 131.nh |
133.SH "NAME" 134CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks, 135CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, 136CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid, 137CRYPTO_destroy_dynlockid, CRYPTO_lock \- OpenSSL thread support 138.SH "SYNOPSIS" 139.IX Header "SYNOPSIS" 140.Vb 1 141\& #include <openssl/crypto.h> | 132.SH "NAME" 133CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks, 134CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, 135CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid, 136CRYPTO_destroy_dynlockid, CRYPTO_lock \- OpenSSL thread support 137.SH "SYNOPSIS" 138.IX Header "SYNOPSIS" 139.Vb 1 140\& #include <openssl/crypto.h> |
142.Ve 143.PP 144.Vb 2 | 141\& |
145\& void CRYPTO_set_locking_callback(void (*locking_function)(int mode, 146\& int n, const char *file, int line)); | 142\& void CRYPTO_set_locking_callback(void (*locking_function)(int mode, 143\& int n, const char *file, int line)); |
147.Ve 148.PP 149.Vb 1 | 144\& |
150\& void CRYPTO_set_id_callback(unsigned long (*id_function)(void)); | 145\& void CRYPTO_set_id_callback(unsigned long (*id_function)(void)); |
151.Ve 152.PP 153.Vb 1 | 146\& |
154\& int CRYPTO_num_locks(void); | 147\& int CRYPTO_num_locks(void); |
155.Ve 156.PP 157.Vb 2 | 148\& 149\& |
158\& /* struct CRYPTO_dynlock_value needs to be defined by the user */ 159\& struct CRYPTO_dynlock_value; | 150\& /* struct CRYPTO_dynlock_value needs to be defined by the user */ 151\& struct CRYPTO_dynlock_value; |
160.Ve 161.PP 162.Vb 7 | 152\& |
163\& void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value * 164\& (*dyn_create_function)(char *file, int line)); 165\& void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function) 166\& (int mode, struct CRYPTO_dynlock_value *l, 167\& const char *file, int line)); 168\& void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function) 169\& (struct CRYPTO_dynlock_value *l, const char *file, int line)); | 153\& void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value * 154\& (*dyn_create_function)(char *file, int line)); 155\& void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function) 156\& (int mode, struct CRYPTO_dynlock_value *l, 157\& const char *file, int line)); 158\& void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function) 159\& (struct CRYPTO_dynlock_value *l, const char *file, int line)); |
170.Ve 171.PP 172.Vb 1 | 160\& |
173\& int CRYPTO_get_new_dynlockid(void); | 161\& int CRYPTO_get_new_dynlockid(void); |
174.Ve 175.PP 176.Vb 1 | 162\& |
177\& void CRYPTO_destroy_dynlockid(int i); | 163\& void CRYPTO_destroy_dynlockid(int i); |
178.Ve 179.PP 180.Vb 1 | 164\& |
181\& void CRYPTO_lock(int mode, int n, const char *file, int line); | 165\& void CRYPTO_lock(int mode, int n, const char *file, int line); |
182.Ve 183.PP 184.Vb 10 | 166\& |
185\& #define CRYPTO_w_lock(type) \e | 167\& #define CRYPTO_w_lock(type) \e |
186\& CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) | 168\& CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,_\|_FILE_\|_,_\|_LINE_\|_) |
187\& #define CRYPTO_w_unlock(type) \e | 169\& #define CRYPTO_w_unlock(type) \e |
188\& CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) | 170\& CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,_\|_FILE_\|_,_\|_LINE_\|_) |
189\& #define CRYPTO_r_lock(type) \e | 171\& #define CRYPTO_r_lock(type) \e |
190\& CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) | 172\& CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,_\|_FILE_\|_,_\|_LINE_\|_) |
191\& #define CRYPTO_r_unlock(type) \e | 173\& #define CRYPTO_r_unlock(type) \e |
192\& CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) | 174\& CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,_\|_FILE_\|_,_\|_LINE_\|_) |
193\& #define CRYPTO_add(addr,amount,type) \e | 175\& #define CRYPTO_add(addr,amount,type) \e |
194\& CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) | 176\& CRYPTO_add_lock(addr,amount,type,_\|_FILE_\|_,_\|_LINE_\|_) |
195.Ve 196.SH "DESCRIPTION" 197.IX Header "DESCRIPTION" 198OpenSSL can safely be used in multi-threaded applications provided 199that at least two callback functions are set. 200.PP 201locking_function(int mode, int n, const char *file, int line) is 202needed to perform locking on shared data structures. --- 11 unchanged lines hidden (view full) --- 214id_function(void) is a function that returns a thread \s-1ID\s0, for example 215\&\fIpthread_self()\fR if it returns an integer (see \s-1NOTES\s0 below). It isn't 216needed on Windows nor on platforms where \fIgetpid()\fR returns a different 217\&\s-1ID\s0 for each thread (see \s-1NOTES\s0 below). 218.PP 219Additionally, OpenSSL supports dynamic locks, and sometimes, some parts 220of OpenSSL need it for better performance. To enable this, the following 221is required: | 177.Ve 178.SH "DESCRIPTION" 179.IX Header "DESCRIPTION" 180OpenSSL can safely be used in multi-threaded applications provided 181that at least two callback functions are set. 182.PP 183locking_function(int mode, int n, const char *file, int line) is 184needed to perform locking on shared data structures. --- 11 unchanged lines hidden (view full) --- 196id_function(void) is a function that returns a thread \s-1ID\s0, for example 197\&\fIpthread_self()\fR if it returns an integer (see \s-1NOTES\s0 below). It isn't 198needed on Windows nor on platforms where \fIgetpid()\fR returns a different 199\&\s-1ID\s0 for each thread (see \s-1NOTES\s0 below). 200.PP 201Additionally, OpenSSL supports dynamic locks, and sometimes, some parts 202of OpenSSL need it for better performance. To enable this, the following 203is required: |
222.IP "* Three additional callback function, dyn_create_function, dyn_lock_function and dyn_destroy_function." 4 223.IX Item "Three additional callback function, dyn_create_function, dyn_lock_function and dyn_destroy_function." 224.PD 0 225.IP "* A structure defined with the data that each lock needs to handle." 4 226.IX Item "A structure defined with the data that each lock needs to handle." 227.PD | 204.IP "\(bu" 4 205Three additional callback function, dyn_create_function, dyn_lock_function 206and dyn_destroy_function. 207.IP "\(bu" 4 208A structure defined with the data that each lock needs to handle. |
228.PP 229struct CRYPTO_dynlock_value has to be defined to contain whatever structure 230is needed to handle locks. 231.PP 232dyn_create_function(const char *file, int line) is needed to create a 233lock. Multi-threaded applications might crash at random if it is not set. 234.PP 235dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line) --- 49 unchanged lines hidden (view full) --- 285.PP 286Defining id_function(void) has it's own issues. Generally speaking, 287\&\fIpthread_self()\fR should be used, even on platforms where \fIgetpid()\fR gives 288different answers in each thread, since that may depend on the machine 289the program is run on, not the machine where the program is being 290compiled. For instance, Red Hat 8 Linux and earlier used 291LinuxThreads, whose \fIgetpid()\fR returns a different value for each 292thread. Red Hat 9 Linux and later use \s-1NPTL\s0, which is | 209.PP 210struct CRYPTO_dynlock_value has to be defined to contain whatever structure 211is needed to handle locks. 212.PP 213dyn_create_function(const char *file, int line) is needed to create a 214lock. Multi-threaded applications might crash at random if it is not set. 215.PP 216dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line) --- 49 unchanged lines hidden (view full) --- 266.PP 267Defining id_function(void) has it's own issues. Generally speaking, 268\&\fIpthread_self()\fR should be used, even on platforms where \fIgetpid()\fR gives 269different answers in each thread, since that may depend on the machine 270the program is run on, not the machine where the program is being 271compiled. For instance, Red Hat 8 Linux and earlier used 272LinuxThreads, whose \fIgetpid()\fR returns a different value for each 273thread. Red Hat 9 Linux and later use \s-1NPTL\s0, which is |
293Posix\-conformant, and has a \fIgetpid()\fR that returns the same value for | 274Posix-conformant, and has a \fIgetpid()\fR that returns the same value for |
294all threads in a process. A program compiled on Red Hat 8 and run on 295Red Hat 9 will therefore see \fIgetpid()\fR returning the same value for 296all threads. 297.PP 298There is still the issue of platforms where \fIpthread_self()\fR returns 299something other than an integer. This is a bit unusual, and this 300manual has no cookbook solution for that case. 301.SH "EXAMPLES" --- 12 unchanged lines hidden --- | 275all threads in a process. A program compiled on Red Hat 8 and run on 276Red Hat 9 will therefore see \fIgetpid()\fR returning the same value for 277all threads. 278.PP 279There is still the issue of platforms where \fIpthread_self()\fR returns 280something other than an integer. This is a bit unusual, and this 281manual has no cookbook solution for that case. 282.SH "EXAMPLES" --- 12 unchanged lines hidden --- |