.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "docs::api::APR::OS 3pm" .TH docs::api::APR::OS 3pm 2024-03-29 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME APR::OS \- Perl API for Platform\-specific APR API .SH Synopsis .IX Header "Synopsis" .Vb 1 \& use APR::OS (); \& \& # get current thread id \& my $tid = APR::OS::current_thread_id(); .Ve .SH Description .IX Header "Description" \&\f(CW\*(C`APR::OS\*(C'\fR provides the Perl interface to platform-specific APR API. .PP You should be extremely careful when relying on any of the API provided by this module, since they are no portable. So if you use those you application will be non-portable as well. .SH API .IX Header "API" \&\f(CW\*(C`APR::OS\*(C'\fR provides the following methods: .ie n .SS """current_thread_id""" .el .SS \f(CWcurrent_thread_id\fP .IX Subsection "current_thread_id" Get the current thread ID .PP .Vb 1 \& $tid = APR::OS::current_thread_id(); .Ve .ie n .IP "ret: $tid ( integer )" 4 .el .IP "ret: \f(CW$tid\fR ( integer )" 4 .IX Item "ret: $tid ( integer )" under threaded MPMs returns the current thread ID, otherwise 0. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP Example: .PP .Vb 9 \& use Apache2::MPM (); \& use APR::OS (); \& if (Apache2::MPM\->is_threaded) { \& my $tid_obj = APR::OS::current_thread_id(); \& print "TID: $tid"; \& } \& else { \& print "PID: $$"; \& } .Ve .SH "See Also" .IX Header "See Also" mod_perl 2.0 documentation. .SH Copyright .IX Header "Copyright" mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. .SH Authors .IX Header "Authors" The mod_perl development team and numerous contributors.