mirror of https://github.com/PCSX2/pcsx2.git
Merge remote-tracking branch 'PCSX2/master'
This commit is contained in:
commit
e11cc951de
|
@ -11,19 +11,33 @@
|
|||
*.dsp
|
||||
*.dsw
|
||||
*.bsc
|
||||
*.mo
|
||||
*.aps
|
||||
|
||||
*.trace
|
||||
*.asm
|
||||
*.dump
|
||||
|
||||
!/pcsx2/IPU/yuv2rgb.asm
|
||||
!/pcsx2/x86/ix86-32/aVif_proc-32.asm
|
||||
!/plugins/CDVDpeops/i386.asm
|
||||
!/plugins/zerogs/dx/x86-32.asm
|
||||
!/plugins/zerogs/dx/x86-64.asm
|
||||
!/plugins/zerogs/opengl/x86-32.asm
|
||||
!/plugins/zzogl-pg/opengl/x86-32.asm
|
||||
|
||||
**/Win32/Release*
|
||||
**/Win32/Debug*
|
||||
**/Win32/Devel*
|
||||
**/x64/Release*
|
||||
**/x64/Debug*
|
||||
**/x64/Devel*
|
||||
|
||||
_ReSharper.*
|
||||
pcsx2.snapshot_*
|
||||
postBuild.inc.cmd
|
||||
postBuild.cmd
|
||||
svnrev.h
|
||||
|
||||
/build
|
||||
/obj-*
|
||||
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
@ -42,7 +56,8 @@ oprofile_data/
|
|||
/UpgradeLog2.XML
|
||||
/UpgradeLog3.XML
|
||||
|
||||
/bin/pcsx2*
|
||||
/bin/PCSX2
|
||||
/bin/*ReplayLoader
|
||||
/bin/bios
|
||||
/bin/dumps
|
||||
/bin/help
|
||||
|
@ -56,9 +71,7 @@ oprofile_data/
|
|||
/ipch
|
||||
/nsis/output/
|
||||
|
||||
/3rdparty/soundtouch/Win32
|
||||
/3rdparty/bzip2/Win32
|
||||
/3rdparty/libjpeg/Win32
|
||||
!/3rdparty/libjpeg/change.log
|
||||
/3rdparty/portaudio/portaudio-2.0.pc
|
||||
/3rdparty/portaudio/bin
|
||||
/3rdparty/portaudio/bin-*
|
||||
|
@ -67,28 +80,14 @@ oprofile_data/
|
|||
/3rdparty/portaudio/config.*
|
||||
/3rdparty/portaudio/lib-stamp
|
||||
/3rdparty/portaudio/Makefile
|
||||
/3rdparty/portaudio/build/*
|
||||
/3rdparty/portaudio/bindings
|
||||
/3rdparty/portaudio/test
|
||||
/3rdparty/portaudio/testcvs
|
||||
/3rdparty/portaudio/build/msvc/Win32
|
||||
/3rdparty/portaudio/build/msvc/Release (NO ASIO)
|
||||
/3rdparty/portaudio/build/msvc/x64
|
||||
/3rdparty/portaudio/src/hostapi/asio/ASIOSDK/common
|
||||
/3rdparty/portaudio/src/hostapi/asio/ASIOSDK/host
|
||||
/3rdparty/portaudio/src/hostapi/wasapi/mingw-include
|
||||
/3rdparty/w32pthreads/Win32
|
||||
/3rdparty/wxWidgets/deps
|
||||
/3rdparty/wxWidgets/build/msw/Win32
|
||||
/3rdparty/wxWidgets/lib/vc_lib/msw/wx/setup.h
|
||||
/3rdparty/wxWidgets/lib/vc_lib/mswd/wx/setup.h
|
||||
/3rdparty/wxWidgets/lib/vc_lib/mswd/wx/msw/rcdefs.h
|
||||
/3rdparty/wxwidgets3.0/include/wx/setup.h
|
||||
/3rdparty/wxwidgets3.0/include/wx/msw/rcdefs.h
|
||||
/3rdparty/zlib/Win32
|
||||
/common/deps
|
||||
/common/build/Utilities/Win32
|
||||
/common/build/x86emitter/Win32
|
||||
/3rdparty/**/include/wx/setup.h
|
||||
/3rdparty/**/wx/msw/rcdefs.h
|
||||
/nsis/svnrev_cdvdiso.nsh
|
||||
/nsis/svnrev_gsdx.nsh
|
||||
/nsis/svnrev_lilypad.nsh
|
||||
|
@ -96,43 +95,14 @@ oprofile_data/
|
|||
/nsis/svnrev_spu2x.nsh
|
||||
/nsis/svnrev_zerogs.nsh
|
||||
/nsis/svnrev_zerospu2.nsh
|
||||
/nsis/vcredist_x86.exe
|
||||
/nsis/vcredist_2008_sp1_x86.exe
|
||||
/nsis/vcredist_2010_x86.exe
|
||||
/nsis/dxwebsetup.exe
|
||||
/pcsx2/gui/Resources/Thumbs.db
|
||||
/nsis/*.exe
|
||||
/pcsx2/gui/Resources/*.h
|
||||
/pcsx2/windows/VCprojects/Win32
|
||||
/plugins/CDVDiso/src/Windows/Win32
|
||||
/plugins/CDVDnull/Windows/Win32
|
||||
/plugins/CDVDolio/Win32
|
||||
/plugins/CDVDolio/x64
|
||||
!/pcsx2/gui/Resources/EmbeddedImage.h
|
||||
/plugins/CDVDolio/Template
|
||||
/plugins/CDVDolio/Debug SSE4
|
||||
/plugins/FWnull/Windows/Win32
|
||||
/plugins/GSdx/Win32
|
||||
/plugins/GSdx/Release SSE2
|
||||
/plugins/GSdx/x64
|
||||
/plugins/GSdx/Template
|
||||
/plugins/GSnull/Windows/Win32
|
||||
/plugins/LilyPad/Win32
|
||||
/plugins/LilyPad/x64
|
||||
/plugins/PadNull/Windows/Win32
|
||||
/plugins/SSSPSXPAD/Win32
|
||||
/plugins/USBnull/Windows/Win32
|
||||
/plugins/USBqemu/Win32/bin
|
||||
/plugins/USBqemu/Win32/Win32
|
||||
/plugins/cdvdGigaherz/src/Windows/Win32
|
||||
/plugins/dev9null/Windows/Win32
|
||||
/plugins/spu2-x/src/Windows/Win32
|
||||
/plugins/xpad/Win32
|
||||
/plugins/xpad/x64
|
||||
/plugins/xpad/Template
|
||||
/plugins/zerogs/dx/Windows/Win32
|
||||
/plugins/zerospu2/Windows/Win32
|
||||
/plugins/zerospu2/Windows/dsound51.cpp
|
||||
/plugins/zzogl-pg/opengl/Win32/Win32
|
||||
/plugins/zzogl-pg-cg/opengl/Win32/Win32
|
||||
/tools/bin
|
||||
/tools/GSDumpGUI/bin
|
||||
/tools/GSDumpGUI/obj
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,327 @@
|
|||
------------------------------------------------------------------
|
||||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
in the file LICENSE.
|
||||
------------------------------------------------------------------
|
||||
|
||||
|
||||
0.9.0
|
||||
~~~~~
|
||||
First version.
|
||||
|
||||
|
||||
0.9.0a
|
||||
~~~~~~
|
||||
Removed 'ranlib' from Makefile, since most modern Unix-es
|
||||
don't need it, or even know about it.
|
||||
|
||||
|
||||
0.9.0b
|
||||
~~~~~~
|
||||
Fixed a problem with error reporting in bzip2.c. This does not effect
|
||||
the library in any way. Problem is: versions 0.9.0 and 0.9.0a (of the
|
||||
program proper) compress and decompress correctly, but give misleading
|
||||
error messages (internal panics) when an I/O error occurs, instead of
|
||||
reporting the problem correctly. This shouldn't give any data loss
|
||||
(as far as I can see), but is confusing.
|
||||
|
||||
Made the inline declarations disappear for non-GCC compilers.
|
||||
|
||||
|
||||
0.9.0c
|
||||
~~~~~~
|
||||
Fixed some problems in the library pertaining to some boundary cases.
|
||||
This makes the library behave more correctly in those situations. The
|
||||
fixes apply only to features (calls and parameters) not used by
|
||||
bzip2.c, so the non-fixedness of them in previous versions has no
|
||||
effect on reliability of bzip2.c.
|
||||
|
||||
In bzlib.c:
|
||||
* made zero-length BZ_FLUSH work correctly in bzCompress().
|
||||
* fixed bzWrite/bzRead to ignore zero-length requests.
|
||||
* fixed bzread to correctly handle read requests after EOF.
|
||||
* wrong parameter order in call to bzDecompressInit in
|
||||
bzBuffToBuffDecompress. Fixed.
|
||||
|
||||
In compress.c:
|
||||
* changed setting of nGroups in sendMTFValues() so as to
|
||||
do a bit better on small files. This _does_ effect
|
||||
bzip2.c.
|
||||
|
||||
|
||||
0.9.5a
|
||||
~~~~~~
|
||||
Major change: add a fallback sorting algorithm (blocksort.c)
|
||||
to give reasonable behaviour even for very repetitive inputs.
|
||||
Nuked --repetitive-best and --repetitive-fast since they are
|
||||
no longer useful.
|
||||
|
||||
Minor changes: mostly a whole bunch of small changes/
|
||||
bugfixes in the driver (bzip2.c). Changes pertaining to the
|
||||
user interface are:
|
||||
|
||||
allow decompression of symlink'd files to stdout
|
||||
decompress/test files even without .bz2 extension
|
||||
give more accurate error messages for I/O errors
|
||||
when compressing/decompressing to stdout, don't catch control-C
|
||||
read flags from BZIP2 and BZIP environment variables
|
||||
decline to break hard links to a file unless forced with -f
|
||||
allow -c flag even with no filenames
|
||||
preserve file ownerships as far as possible
|
||||
make -s -1 give the expected block size (100k)
|
||||
add a flag -q --quiet to suppress nonessential warnings
|
||||
stop decoding flags after --, so files beginning in - can be handled
|
||||
resolved inconsistent naming: bzcat or bz2cat ?
|
||||
bzip2 --help now returns 0
|
||||
|
||||
Programming-level changes are:
|
||||
|
||||
fixed syntax error in GET_LL4 for Borland C++ 5.02
|
||||
let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}
|
||||
fix overshoot of mode-string end in bzopen_or_bzdopen
|
||||
wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... }
|
||||
close file handles under all error conditions
|
||||
added minor mods so it compiles with DJGPP out of the box
|
||||
fixed Makefile so it doesn't give problems with BSD make
|
||||
fix uninitialised memory reads in dlltest.c
|
||||
|
||||
0.9.5b
|
||||
~~~~~~
|
||||
Open stdin/stdout in binary mode for DJGPP.
|
||||
|
||||
0.9.5c
|
||||
~~~~~~
|
||||
Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1. The + 1
|
||||
version could cause the sorted order to be wrong in some extremely
|
||||
obscure cases. Also changed setting of quadrant in blocksort.c.
|
||||
|
||||
0.9.5d
|
||||
~~~~~~
|
||||
The only functional change is to make bzlibVersion() in the library
|
||||
return the correct string. This has no effect whatsoever on the
|
||||
functioning of the bzip2 program or library. Added a couple of casts
|
||||
so the library compiles without warnings at level 3 in MS Visual
|
||||
Studio 6.0. Included a Y2K statement in the file Y2K_INFO. All other
|
||||
changes are minor documentation changes.
|
||||
|
||||
1.0
|
||||
~~~
|
||||
Several minor bugfixes and enhancements:
|
||||
|
||||
* Large file support. The library uses 64-bit counters to
|
||||
count the volume of data passing through it. bzip2.c
|
||||
is now compiled with -D_FILE_OFFSET_BITS=64 to get large
|
||||
file support from the C library. -v correctly prints out
|
||||
file sizes greater than 4 gigabytes. All these changes have
|
||||
been made without assuming a 64-bit platform or a C compiler
|
||||
which supports 64-bit ints, so, except for the C library
|
||||
aspect, they are fully portable.
|
||||
|
||||
* Decompression robustness. The library/program should be
|
||||
robust to any corruption of compressed data, detecting and
|
||||
handling _all_ corruption, instead of merely relying on
|
||||
the CRCs. What this means is that the program should
|
||||
never crash, given corrupted data, and the library should
|
||||
always return BZ_DATA_ERROR.
|
||||
|
||||
* Fixed an obscure race-condition bug only ever observed on
|
||||
Solaris, in which, if you were very unlucky and issued
|
||||
control-C at exactly the wrong time, both input and output
|
||||
files would be deleted.
|
||||
|
||||
* Don't run out of file handles on test/decompression when
|
||||
large numbers of files have invalid magic numbers.
|
||||
|
||||
* Avoid library namespace pollution. Prefix all exported
|
||||
symbols with BZ2_.
|
||||
|
||||
* Minor sorting enhancements from my DCC2000 paper.
|
||||
|
||||
* Advance the version number to 1.0, so as to counteract the
|
||||
(false-in-this-case) impression some people have that programs
|
||||
with version numbers less than 1.0 are in some way, experimental,
|
||||
pre-release versions.
|
||||
|
||||
* Create an initial Makefile-libbz2_so to build a shared library.
|
||||
Yes, I know I should really use libtool et al ...
|
||||
|
||||
* Make the program exit with 2 instead of 0 when decompression
|
||||
fails due to a bad magic number (ie, an invalid bzip2 header).
|
||||
Also exit with 1 (as the manual claims :-) whenever a diagnostic
|
||||
message would have been printed AND the corresponding operation
|
||||
is aborted, for example
|
||||
bzip2: Output file xx already exists.
|
||||
When a diagnostic message is printed but the operation is not
|
||||
aborted, for example
|
||||
bzip2: Can't guess original name for wurble -- using wurble.out
|
||||
then the exit value 0 is returned, unless some other problem is
|
||||
also detected.
|
||||
|
||||
I think it corresponds more closely to what the manual claims now.
|
||||
|
||||
|
||||
1.0.1
|
||||
~~~~~
|
||||
* Modified dlltest.c so it uses the new BZ2_ naming scheme.
|
||||
* Modified makefile-msc to fix minor build probs on Win2k.
|
||||
* Updated README.COMPILATION.PROBLEMS.
|
||||
|
||||
There are no functionality changes or bug fixes relative to version
|
||||
1.0.0. This is just a documentation update + a fix for minor Win32
|
||||
build problems. For almost everyone, upgrading from 1.0.0 to 1.0.1 is
|
||||
utterly pointless. Don't bother.
|
||||
|
||||
|
||||
1.0.2
|
||||
~~~~~
|
||||
A bug fix release, addressing various minor issues which have appeared
|
||||
in the 18 or so months since 1.0.1 was released. Most of the fixes
|
||||
are to do with file-handling or documentation bugs. To the best of my
|
||||
knowledge, there have been no data-loss-causing bugs reported in the
|
||||
compression/decompression engine of 1.0.0 or 1.0.1.
|
||||
|
||||
Note that this release does not improve the rather crude build system
|
||||
for Unix platforms. The general plan here is to autoconfiscate/
|
||||
libtoolise 1.0.2 soon after release, and release the result as 1.1.0
|
||||
or perhaps 1.2.0. That, however, is still just a plan at this point.
|
||||
|
||||
Here are the changes in 1.0.2. Bug-reporters and/or patch-senders in
|
||||
parentheses.
|
||||
|
||||
* Fix an infinite segfault loop in 1.0.1 when a directory is
|
||||
encountered in -f (force) mode.
|
||||
(Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt)
|
||||
|
||||
* Avoid double fclose() of output file on certain I/O error paths.
|
||||
(Solar Designer)
|
||||
|
||||
* Don't fail with internal error 1007 when fed a long stream (> 48MB)
|
||||
of byte 251. Also print useful message suggesting that 1007s may be
|
||||
caused by bad memory.
|
||||
(noticed by Juan Pedro Vallejo, fixed by me)
|
||||
|
||||
* Fix uninitialised variable silly bug in demo prog dlltest.c.
|
||||
(Jorj Bauer)
|
||||
|
||||
* Remove 512-MB limitation on recovered file size for bzip2recover
|
||||
on selected platforms which support 64-bit ints. At the moment
|
||||
all GCC supported platforms, and Win32.
|
||||
(me, Alson van der Meulen)
|
||||
|
||||
* Hard-code header byte values, to give correct operation on platforms
|
||||
using EBCDIC as their native character set (IBM's OS/390).
|
||||
(Leland Lucius)
|
||||
|
||||
* Copy file access times correctly.
|
||||
(Marty Leisner)
|
||||
|
||||
* Add distclean and check targets to Makefile.
|
||||
(Michael Carmack)
|
||||
|
||||
* Parameterise use of ar and ranlib in Makefile. Also add $(LDFLAGS).
|
||||
(Rich Ireland, Bo Thorsen)
|
||||
|
||||
* Pass -p (create parent dirs as needed) to mkdir during make install.
|
||||
(Jeremy Fusco)
|
||||
|
||||
* Dereference symlinks when copying file permissions in -f mode.
|
||||
(Volker Schmidt)
|
||||
|
||||
* Majorly simplify implementation of uInt64_qrm10.
|
||||
(Bo Lindbergh)
|
||||
|
||||
* Check the input file still exists before deleting the output one,
|
||||
when aborting in cleanUpAndFail().
|
||||
(Joerg Prante, Robert Linden, Matthias Krings)
|
||||
|
||||
Also a bunch of patches courtesy of Philippe Troin, the Debian maintainer
|
||||
of bzip2:
|
||||
|
||||
* Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore.
|
||||
|
||||
* Spelling changes and minor enhancements in bzip2.1.
|
||||
|
||||
* Avoid race condition between creating the output file and setting its
|
||||
interim permissions safely, by using fopen_output_safely().
|
||||
No changes to bzip2recover since there is no issue with file
|
||||
permissions there.
|
||||
|
||||
* do not print senseless report with -v when compressing an empty
|
||||
file.
|
||||
|
||||
* bzcat -f works on non-bzip2 files.
|
||||
|
||||
* do not try to escape shell meta-characters on unix (the shell takes
|
||||
care of these).
|
||||
|
||||
* added --fast and --best aliases for -1 -9 for gzip compatibility.
|
||||
|
||||
|
||||
1.0.3 (15 Feb 05)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
Fixes some minor bugs since the last version, 1.0.2.
|
||||
|
||||
* Further robustification against corrupted compressed data.
|
||||
There are currently no known bitstreams which can cause the
|
||||
decompressor to crash, loop or access memory which does not
|
||||
belong to it. If you are using bzip2 or the library to
|
||||
decompress bitstreams from untrusted sources, an upgrade
|
||||
to 1.0.3 is recommended. This fixes CAN-2005-1260.
|
||||
|
||||
* The documentation has been converted to XML, from which html
|
||||
and pdf can be derived.
|
||||
|
||||
* Various minor bugs in the documentation have been fixed.
|
||||
|
||||
* Fixes for various compilation warnings with newer versions of
|
||||
gcc, and on 64-bit platforms.
|
||||
|
||||
* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2.
|
||||
This has been fixed.
|
||||
|
||||
|
||||
1.0.4 (20 Dec 06)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
Fixes some minor bugs since the last version, 1.0.3.
|
||||
|
||||
* Fix file permissions race problem (CAN-2005-0953).
|
||||
|
||||
* Avoid possible segfault in BZ2_bzclose. From Coverity's NetBSD
|
||||
scan.
|
||||
|
||||
* 'const'/prototype cleanups in the C code.
|
||||
|
||||
* Change default install location to /usr/local, and handle multiple
|
||||
'make install's without error.
|
||||
|
||||
* Sanitise file names more carefully in bzgrep. Fixes CAN-2005-0758
|
||||
to the extent that applies to bzgrep.
|
||||
|
||||
* Use 'mktemp' rather than 'tempfile' in bzdiff.
|
||||
|
||||
* Tighten up a couple of assertions in blocksort.c following automated
|
||||
analysis.
|
||||
|
||||
* Fix minor doc/comment bugs.
|
||||
|
||||
|
||||
1.0.5 (10 Dec 07)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
|
||||
|
||||
|
||||
1.0.6 (6 Sept 10)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Security fix for CVE-2010-0405. This was reported by Mikolaj
|
||||
Izdebski.
|
||||
|
||||
* Make the documentation build on Ubuntu 10.04
|
|
@ -2,7 +2,7 @@
|
|||
--------------------------------------------------------------------------
|
||||
|
||||
This program, "bzip2", the associated library "libbzip2", and all
|
||||
documentation, are copyright (C) 1996-2006 Julian R Seward. All
|
||||
documentation, are copyright (C) 1996-2010 Julian R Seward. All
|
||||
rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
@ -36,8 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Julian Seward, Cambridge, UK.
|
||||
jseward@bzip.org
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Julian Seward, jseward@bzip.org
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
|
|
@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases.
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
|
||||
|
||||
|
@ -177,6 +177,14 @@ WHAT'S NEW IN 1.0.4 ?
|
|||
|
||||
See the CHANGES file.
|
||||
|
||||
WHAT'S NEW IN 1.0.5 ?
|
||||
|
||||
See the CHANGES file.
|
||||
|
||||
WHAT'S NEW IN 1.0.6 ?
|
||||
|
||||
See the CHANGES file.
|
||||
|
||||
|
||||
I hope you find bzip2 useful. Feel free to contact me at
|
||||
jseward@bzip.org
|
||||
|
@ -203,3 +211,5 @@ Cambridge, UK.
|
|||
30 December 2001 (bzip2, version 1.0.2pre1)
|
||||
15 February 2005 (bzip2, version 1.0.3)
|
||||
20 December 2006 (bzip2, version 1.0.4)
|
||||
10 December 2007 (bzip2, version 1.0.5)
|
||||
6 Sept 2010 (bzip2, version 1.0.6)
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
|
@ -24,18 +24,18 @@
|
|||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
|
@ -1,96 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Devel|Win32">
|
||||
<Configuration>Devel</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F4EB4AB2-C595-4B05-8BC0-059024BC796C}</ProjectGuid>
|
||||
<RootNamespace>bzip2</RootNamespace>
|
||||
<ProjectName>bzip2</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\3rdparty.props" />
|
||||
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
|
||||
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\3rdparty.props" />
|
||||
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\3rdparty.props" />
|
||||
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
|
||||
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="blocksort.c" />
|
||||
<ClCompile Include="bzlib.c" />
|
||||
<ClCompile Include="compress.c" />
|
||||
<ClCompile Include="crctable.c" />
|
||||
<ClCompile Include="decompress.c" />
|
||||
<ClCompile Include="huffman.c" />
|
||||
<ClCompile Include="randtable.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="bzlib.h" />
|
||||
<ClInclude Include="bzlib_private.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="blocksort.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="bzlib.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="compress.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="crctable.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="decompress.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="huffman.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="randtable.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="bzlib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="bzlib_private.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
@ -48,7 +48,7 @@ void BZ2_bz__AssertH__fail ( int errcode )
|
|||
"component, you should also report this bug to the author(s)\n"
|
||||
"of that program. Please make an effort to report this bug;\n"
|
||||
"timely and accurate bug reports eventually lead to higher\n"
|
||||
"quality software. Thanks. Julian Seward, 15 February 2005.\n\n",
|
||||
"quality software. Thanks. Julian Seward, 10 December 2007.\n\n",
|
||||
errcode,
|
||||
BZ2_bzlibVersion()
|
||||
);
|
||||
|
@ -598,6 +598,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
|
|||
UInt32 c_tPos = s->tPos;
|
||||
char* cs_next_out = s->strm->next_out;
|
||||
unsigned int cs_avail_out = s->strm->avail_out;
|
||||
Int32 ro_blockSize100k = s->blockSize100k;
|
||||
/* end restore */
|
||||
|
||||
UInt32 avail_out_INIT = cs_avail_out;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
/*-- General stuff. --*/
|
||||
|
||||
#define BZ_VERSION "1.0.4, 20-Dec-2006"
|
||||
#define BZ_VERSION "1.0.6, 6-Sept-2010"
|
||||
|
||||
typedef char Char;
|
||||
typedef unsigned char Bool;
|
||||
|
@ -442,11 +442,15 @@ typedef
|
|||
/*-- Macros for decompression. --*/
|
||||
|
||||
#define BZ_GET_FAST(cccc) \
|
||||
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
|
||||
if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \
|
||||
s->tPos = s->tt[s->tPos]; \
|
||||
cccc = (UChar)(s->tPos & 0xff); \
|
||||
s->tPos >>= 8;
|
||||
|
||||
#define BZ_GET_FAST_C(cccc) \
|
||||
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
|
||||
if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \
|
||||
c_tPos = c_tt[c_tPos]; \
|
||||
cccc = (UChar)(c_tPos & 0xff); \
|
||||
c_tPos >>= 8;
|
||||
|
@ -469,8 +473,10 @@ typedef
|
|||
(((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))
|
||||
|
||||
#define BZ_GET_SMALL(cccc) \
|
||||
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
|
||||
s->tPos = GET_LL(s->tPos);
|
||||
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
|
||||
if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \
|
||||
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
|
||||
s->tPos = GET_LL(s->tPos);
|
||||
|
||||
|
||||
/*-- externs for decompression. --*/
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
@ -381,6 +381,13 @@ Int32 BZ2_decompress ( DState* s )
|
|||
es = -1;
|
||||
N = 1;
|
||||
do {
|
||||
/* Check that N doesn't get too big, so that es doesn't
|
||||
go negative. The maximum value that can be
|
||||
RUNA/RUNB encoded is equal to the block size (post
|
||||
the initial RLE), viz, 900k, so bounding N at 2
|
||||
million should guard against overflow without
|
||||
rejecting any legitimate inputs. */
|
||||
if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);
|
||||
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
|
||||
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
|
||||
N = N * 2;
|
||||
|
@ -485,15 +492,28 @@ Int32 BZ2_decompress ( DState* s )
|
|||
RETURN(BZ_DATA_ERROR);
|
||||
|
||||
/*-- Set up cftab to facilitate generation of T^(-1) --*/
|
||||
/* Check: unzftab entries in range. */
|
||||
for (i = 0; i <= 255; i++) {
|
||||
if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
|
||||
RETURN(BZ_DATA_ERROR);
|
||||
}
|
||||
/* Actually generate cftab. */
|
||||
s->cftab[0] = 0;
|
||||
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
|
||||
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
|
||||
/* Check: cftab entries in range. */
|
||||
for (i = 0; i <= 256; i++) {
|
||||
if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
|
||||
/* s->cftab[i] can legitimately be == nblock */
|
||||
RETURN(BZ_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
/* Check: cftab entries non-descending. */
|
||||
for (i = 1; i <= 256; i++) {
|
||||
if (s->cftab[i-1] > s->cftab[i]) {
|
||||
RETURN(BZ_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
s->state_out_len = 0;
|
||||
s->state_out_ch = 0;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
This file is part of bzip2/libbzip2, a program and library for
|
||||
lossless, block-sorting data compression.
|
||||
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
||||
bzip2/libbzip2 version 1.0.6 of 6 September 2010
|
||||
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
|
@ -25,18 +25,18 @@
|
|||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
|
@ -1,165 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Devel|Win32">
|
||||
<Configuration>Devel</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>libjpeg7</ProjectName>
|
||||
<ProjectGuid>{BC236261-77E8-4567-8D09-45CD02965EB6}</ProjectGuid>
|
||||
<RootNamespace>libjpeg</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\3rdparty.props" />
|
||||
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
|
||||
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\3rdparty.props" />
|
||||
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\3rdparty.props" />
|
||||
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
|
||||
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jaricom.c" />
|
||||
<ClCompile Include="jcapimin.c" />
|
||||
<ClCompile Include="jcapistd.c" />
|
||||
<ClCompile Include="jcarith.c" />
|
||||
<ClCompile Include="jccoefct.c" />
|
||||
<ClCompile Include="jccolor.c" />
|
||||
<ClCompile Include="jcdctmgr.c" />
|
||||
<ClCompile Include="jchuff.c" />
|
||||
<ClCompile Include="jcinit.c" />
|
||||
<ClCompile Include="jcmainct.c" />
|
||||
<ClCompile Include="jcmarker.c" />
|
||||
<ClCompile Include="jcmaster.c" />
|
||||
<ClCompile Include="jcomapi.c" />
|
||||
<ClCompile Include="jcparam.c" />
|
||||
<ClCompile Include="jcprepct.c" />
|
||||
<ClCompile Include="jcsample.c" />
|
||||
<ClCompile Include="jctrans.c" />
|
||||
<ClCompile Include="jdapimin.c" />
|
||||
<ClCompile Include="jdapistd.c" />
|
||||
<ClCompile Include="jdarith.c" />
|
||||
<ClCompile Include="jdatadst.c" />
|
||||
<ClCompile Include="jdatasrc.c" />
|
||||
<ClCompile Include="jdcoefct.c" />
|
||||
<ClCompile Include="jdcolor.c" />
|
||||
<ClCompile Include="jddctmgr.c" />
|
||||
<ClCompile Include="jdhuff.c" />
|
||||
<ClCompile Include="jdinput.c" />
|
||||
<ClCompile Include="jdmainct.c" />
|
||||
<ClCompile Include="jdmarker.c" />
|
||||
<ClCompile Include="jdmaster.c" />
|
||||
<ClCompile Include="jdmerge.c" />
|
||||
<ClCompile Include="jdpostct.c" />
|
||||
<ClCompile Include="jdsample.c" />
|
||||
<ClCompile Include="jdtrans.c" />
|
||||
<ClCompile Include="jerror.c" />
|
||||
<ClCompile Include="jfdctflt.c" />
|
||||
<ClCompile Include="jfdctfst.c" />
|
||||
<ClCompile Include="jfdctint.c" />
|
||||
<ClCompile Include="jidctflt.c" />
|
||||
<ClCompile Include="jidctfst.c" />
|
||||
<ClCompile Include="jidctint.c" />
|
||||
<ClCompile Include="jmemansi.c" />
|
||||
<ClCompile Include="jmemmgr.c" />
|
||||
<ClCompile Include="jquant1.c" />
|
||||
<ClCompile Include="jquant2.c" />
|
||||
<ClCompile Include="jutils.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="jconfig.h" />
|
||||
<ClInclude Include="jdct.h" />
|
||||
<ClInclude Include="jerror.h" />
|
||||
<ClInclude Include="jinclude.h" />
|
||||
<ClInclude Include="jmemsys.h" />
|
||||
<ClInclude Include="jmorecfg.h" />
|
||||
<ClInclude Include="jpegint.h" />
|
||||
<ClInclude Include="jpeglib.h" />
|
||||
<ClInclude Include="jversion.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="change.log" />
|
||||
<None Include="filelist.txt" />
|
||||
<None Include="README" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,183 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jaricom.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcapimin.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcapistd.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcarith.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jccoefct.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jccolor.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcdctmgr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jchuff.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcinit.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcmainct.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcmarker.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcmaster.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcomapi.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcparam.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcprepct.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jcsample.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jctrans.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdapimin.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdapistd.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdarith.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdatadst.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdatasrc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdcoefct.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdcolor.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jddctmgr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdhuff.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdinput.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdmainct.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdmarker.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdmaster.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdmerge.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdpostct.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdsample.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jdtrans.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jerror.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jfdctflt.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jfdctfst.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jfdctint.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jidctflt.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jidctfst.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jidctint.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jmemansi.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jmemmgr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jquant1.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jquant2.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="jutils.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="jconfig.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jdct.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jerror.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jinclude.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jmemsys.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jmorecfg.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jpegint.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jpeglib.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="jversion.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="change.log" />
|
||||
<None Include="filelist.txt" />
|
||||
<None Include="README" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="11.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
|
@ -23,19 +23,19 @@
|
|||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@ -172,5 +172,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
||||
</Project>
|
|
@ -1,176 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Devel|Win32">
|
||||
<Configuration>Devel</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>libpng</ProjectName>
|
||||
<ProjectGuid>{D6973076-9317-4EF2-A0B8-B7A18AC0713E}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\..\3rdparty.props" />
|
||||
<Import Project="..\..\..\..\..\common\vsprops\CodeGen_Debug.props" />
|
||||
<Import Project="..\..\..\..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\..\3rdparty.props" />
|
||||
<Import Project="..\..\..\..\..\common\vsprops\CodeGen_Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\..\3rdparty.props" />
|
||||
<Import Project="..\..\..\..\..\common\vsprops\IncrementalLinking.props" />
|
||||
<Import Project="..\..\..\..\..\common\vsprops\CodeGen_Devel.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildBeforeTargets>
|
||||
</CustomBuildBeforeTargets>
|
||||
<OutDir>$(SolutionDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildBeforeTargets>
|
||||
</CustomBuildBeforeTargets>
|
||||
<OutDir>$(SolutionDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildBeforeTargets />
|
||||
<OutDir>$(SolutionDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<DisableSpecificWarnings>4996;4127</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\3rdparty\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Disabled</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>zlib.lib</AdditionalDependencies>
|
||||
<Version>16</Version>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<DisableSpecificWarnings>4996;4127</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\3rdparty\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Full</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>zlib.lib</AdditionalDependencies>
|
||||
<Version>16</Version>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<DisableSpecificWarnings>4996;4127</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\3rdparty\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Full</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>zlib.lib</AdditionalDependencies>
|
||||
<Version>16</Version>
|
||||
<AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\png.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\pngerror.c" />
|
||||
<ClCompile Include="..\..\..\pngget.c" />
|
||||
<ClCompile Include="..\..\..\pngmem.c" />
|
||||
<ClCompile Include="..\..\..\pngpread.c" />
|
||||
<ClCompile Include="..\..\..\pngread.c" />
|
||||
<ClCompile Include="..\..\..\pngrio.c" />
|
||||
<ClCompile Include="..\..\..\pngrtran.c" />
|
||||
<ClCompile Include="..\..\..\pngrutil.c" />
|
||||
<ClCompile Include="..\..\..\pngset.c" />
|
||||
<ClCompile Include="..\..\..\pngtrans.c" />
|
||||
<ClCompile Include="..\..\..\pngwio.c" />
|
||||
<ClCompile Include="..\..\..\pngwrite.c" />
|
||||
<ClCompile Include="..\..\..\pngwtran.c" />
|
||||
<ClCompile Include="..\..\..\pngwutil.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
|
@ -27,26 +27,26 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug (NO ASIO)|Win32">
|
||||
<Configuration>Debug (NO ASIO)</Configuration>
|
||||
|
@ -43,51 +43,51 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
@ -1,669 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug (NO ASIO)|Win32">
|
||||
<Configuration>Debug (NO ASIO)</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug (NO ASIO)|x64">
|
||||
<Configuration>Debug (NO ASIO)</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release (NO ASIO)|Win32">
|
||||
<Configuration>Release (NO ASIO)</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release (NO ASIO)|x64">
|
||||
<Configuration>Release (NO ASIO)</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0A18A071-125E-442F-AFF7-A3F68ABECF99}</ProjectGuid>
|
||||
<RootNamespace>portaudio</RootNamespace>
|
||||
<ProjectName>portaudio</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="ProjectRootDir.props" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
<Import Project="..\..\..\..\common\vsprops\CodeGen_Debug.props" />
|
||||
<Import Project="..\..\..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="ProjectRootDir.props" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
<Import Project="..\..\..\..\common\vsprops\CodeGen_Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="ProjectRootDir.props" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
<Import Project="..\..\..\..\common\vsprops\CodeGen_Debug.props" />
|
||||
<Import Project="..\..\..\..\common\vsprops\IncrementalLinking.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="ProjectRootDir.props" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
<Import Project="..\..\..\..\common\vsprops\CodeGen_Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
|
||||
<Import Project="..\..\..\3rdpartyDLL.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_DS=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;PA_USE_WMME=0;PA_USE_ASIO=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Lib>
|
||||
<AdditionalDependencies>ksuser.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)/portaudio_x64.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_DS=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;PA_USE_WMME=0;PA_USE_ASIO=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Lib>
|
||||
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
|
||||
<AdditionalDependencies>ksuser.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)\portaudio_x64.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)/portaudio_x64.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_DS=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;PA_USE_WMME=0;PA_USE_ASIO=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Lib>
|
||||
<AdditionalDependencies>ksuser.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)/portaudio_x64.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_DS=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;PA_USE_WMME=0;PA_USE_ASIO=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<Lib>
|
||||
<AdditionalDependencies>ksuser.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;..\..\include;.\;..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
|
||||
<ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(Platform)\$(Configuration)\</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<ImportLibrary>$(Platform)\$(Configuration)\portaudio_x64.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<Bscmake>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<OutputFile>$(Platform)\$(Configuration)/portaudio_x64.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\common\pa_allocation.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_converters.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_cpuload.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_debugprint.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_dither.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_front.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_process.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_ringbuffer.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_stream.c" />
|
||||
<ClCompile Include="..\..\src\common\pa_trace.c" />
|
||||
<ClCompile Include="..\..\src\hostapi\asio\pa_asio.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\asio.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\host\ASIOConvertSamples.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\host\asiodrivers.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\host\pc\asiolist.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\combase.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\debugmessage.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\register.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release (NO ASIO)|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\hostapi\asio\ASIOSDK\host;..\..\src\hostapi\asio\ASIOSDK\host\pc;..\..\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\dsound\pa_win_ds.c" />
|
||||
<ClCompile Include="..\..\src\hostapi\dsound\pa_win_ds_dynlink.c" />
|
||||
<ClCompile Include="..\..\src\hostapi\wdmks\pa_win_wdmks.c" />
|
||||
<ClCompile Include="..\..\src\hostapi\wmme\pa_win_wmme.c" />
|
||||
<ClCompile Include="..\..\src\hostapi\wasapi\pa_win_wasapi.c" />
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_coinitialize.c" />
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_hostapis.c" />
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_util.c" />
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_waveformat.c" />
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_wdmks_utils.c" />
|
||||
<ClCompile Include="..\..\src\os\win\pa_x86_plain_converters.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\src\hostapi\wdmks\readme.txt" />
|
||||
<None Include="portaudio.def" />
|
||||
<None Include="portaudio_noasio.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\pa_asio.h" />
|
||||
<ClInclude Include="..\..\include\pa_jack.h" />
|
||||
<ClInclude Include="..\..\include\pa_linux_alsa.h" />
|
||||
<ClInclude Include="..\..\include\pa_mac_core.h" />
|
||||
<ClInclude Include="..\..\include\pa_win_ds.h" />
|
||||
<ClInclude Include="..\..\include\pa_win_wasapi.h" />
|
||||
<ClInclude Include="..\..\include\pa_win_waveformat.h" />
|
||||
<ClInclude Include="..\..\include\pa_win_wdmks.h" />
|
||||
<ClInclude Include="..\..\include\pa_win_wmme.h" />
|
||||
<ClInclude Include="..\..\include\portaudio.h" />
|
||||
<ClInclude Include="..\..\src\os\win\pa_win_coinitialize.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,182 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{5cc0e5d8-728d-40a7-8083-5b983fd1aee7}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\common">
|
||||
<UniqueIdentifier>{a858f4ea-8d6b-4443-90f9-c2dd3b140b6b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi">
|
||||
<UniqueIdentifier>{0ce101a1-ed76-41ee-82e4-64060016158b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi\ASIO">
|
||||
<UniqueIdentifier>{add87864-e960-4687-b000-d88213e2b2d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi\ASIO\ASIOSDK">
|
||||
<UniqueIdentifier>{6766d178-09d3-4194-9e43-0311d503035c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi\dsound">
|
||||
<UniqueIdentifier>{07c0df04-c6c4-4eb9-b645-d56ade6252fd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi\wmme">
|
||||
<UniqueIdentifier>{ee059c3c-2663-474c-bc48-385c1db73147}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi\wasapi">
|
||||
<UniqueIdentifier>{1782b100-f22f-4c73-812d-a3c654dc9825}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\os">
|
||||
<UniqueIdentifier>{1af05f1a-04d9-40b1-890c-1a34a9d0192e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\os\win">
|
||||
<UniqueIdentifier>{b6f829a2-cf78-4f0e-b051-8fccf66c5213}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{b10684c7-978c-4840-be31-71d29889162c}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{78689f06-8c26-4417-93e2-b809a8c41ee7}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\hostapi\wdmks">
|
||||
<UniqueIdentifier>{0d9360dd-9d00-434a-ab46-7a89b2d35fd0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\common\pa_allocation.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_converters.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_cpuload.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_debugprint.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_dither.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_front.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_process.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_ringbuffer.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_stream.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\common\pa_trace.c">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\pa_asio.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\asio.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\host\ASIOConvertSamples.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\host\asiodrivers.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\host\pc\asiolist.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\combase.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\debugmessage.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\asio\ASIOSDK\common\register.cpp">
|
||||
<Filter>Source Files\hostapi\ASIO\ASIOSDK</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\dsound\pa_win_ds.c">
|
||||
<Filter>Source Files\hostapi\dsound</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\dsound\pa_win_ds_dynlink.c">
|
||||
<Filter>Source Files\hostapi\dsound</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\wmme\pa_win_wmme.c">
|
||||
<Filter>Source Files\hostapi\wmme</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\wasapi\pa_win_wasapi.c">
|
||||
<Filter>Source Files\hostapi\wasapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_hostapis.c">
|
||||
<Filter>Source Files\os\win</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_util.c">
|
||||
<Filter>Source Files\os\win</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_waveformat.c">
|
||||
<Filter>Source Files\os\win</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_wdmks_utils.c">
|
||||
<Filter>Source Files\os\win</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\os\win\pa_x86_plain_converters.c">
|
||||
<Filter>Source Files\os\win</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hostapi\wdmks\pa_win_wdmks.c">
|
||||
<Filter>Source Files\hostapi\wdmks</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\os\win\pa_win_coinitialize.c">
|
||||
<Filter>Source Files\os\win</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="portaudio.def">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="portaudio_noasio.def">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="..\..\src\hostapi\wdmks\readme.txt">
|
||||
<Filter>Source Files\hostapi\wdmks</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\pa_asio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_jack.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_linux_alsa.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_mac_core.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_win_ds.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_win_wasapi.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_win_waveformat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_win_wmme.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\portaudio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\os\win\pa_win_coinitialize.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\pa_win_wdmks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,8 +1,8 @@
|
|||
PTHREADS-WIN32 RELEASE 2.8.0 (2006-12-22)
|
||||
-----------------------------------------
|
||||
Web Site: http://sources.redhat.com/pthreads-win32/
|
||||
FTP Site: ftp://sources.redhat.com/pub/pthreads-win32
|
||||
Maintainer: Ross Johnson <rpj@callisto.canberra.edu.au>
|
||||
PTHREADS-WIN32 RELEASE 2.9.0 (2012-05-25)
|
||||
-----------------------------------------
|
||||
Web Site: http://sourceware.org/pthreads-win32/
|
||||
FTP Site: ftp://sourceware.org/pub/pthreads-win32
|
||||
Maintainer: Ross Johnson <ross.johnson@loungebythelake.net>
|
||||
|
||||
|
||||
We are pleased to announce the availability of a new release of
|
||||
|
@ -23,7 +23,7 @@ General Public License (LGPL).
|
|||
Acknowledgements
|
||||
----------------
|
||||
This library is based originally on a Win32 pthreads
|
||||
implementation contributed by John Bossom <John.Bossom@cognos.com>.
|
||||
implementation contributed by John Bossom.
|
||||
|
||||
The implementation of Condition Variables uses algorithms developed
|
||||
by Alexander Terekhov and Louis Thomas.
|
||||
|
@ -50,7 +50,7 @@ were extracted from it.
|
|||
There is also a separate CONTRIBUTORS file. This file and others are
|
||||
on the web site:
|
||||
|
||||
http://sources.redhat.com/pthreads-win32
|
||||
http://sourceware.org/pthreads-win32
|
||||
|
||||
As much as possible, the ChangeLog file acknowledges contributions to the
|
||||
code base in more detail.
|
||||
|
@ -154,12 +154,16 @@ The following functions are implemented:
|
|||
PTHREAD_MUTEX_NORMAL
|
||||
PTHREAD_MUTEX_ERRORCHECK
|
||||
PTHREAD_MUTEX_RECURSIVE )
|
||||
pthread_mutexattr_getrobust
|
||||
pthread_mutexattr_setrobust (values: PTHREAD_MUTEX_STALLED
|
||||
PTHREAD_MUTEX_ROBUST)
|
||||
pthread_mutex_init
|
||||
pthread_mutex_destroy
|
||||
pthread_mutex_lock
|
||||
pthread_mutex_trylock
|
||||
pthread_mutex_timedlock
|
||||
pthread_mutex_unlock
|
||||
pthread_mutex_consistent
|
||||
|
||||
---------------------------
|
||||
Condition Variables
|
||||
|
@ -262,6 +266,7 @@ The following functions are implemented:
|
|||
pthread_getw32threadhandle_np
|
||||
pthread_timechange_handler_np
|
||||
pthread_delay_np
|
||||
pthread_getunique_np
|
||||
pthread_mutexattr_getkind_np
|
||||
pthread_mutexattr_setkind_np (types: PTHREAD_MUTEX_FAST_NP,
|
||||
PTHREAD_MUTEX_ERRORCHECK_NP,
|
||||
|
@ -269,14 +274,15 @@ The following functions are implemented:
|
|||
PTHREAD_MUTEX_ADAPTIVE_NP,
|
||||
PTHREAD_MUTEX_TIMED_NP)
|
||||
pthread_num_processors_np
|
||||
pthread_win32_process_attach_np (Required when statically linking
|
||||
the library)
|
||||
pthread_win32_process_detach_np (Required when statically linking
|
||||
the library)
|
||||
pthread_win32_thread_attach_np (Required when statically linking
|
||||
the library)
|
||||
pthread_win32_thread_detach_np (Required when statically linking
|
||||
the library)
|
||||
(The following four routines may be required when linking statically.
|
||||
The process_* routines should not be needed for MSVC or GCC.)
|
||||
pthread_win32_process_attach_np
|
||||
pthread_win32_process_detach_np
|
||||
(The following routines should only be needed to manage implicit
|
||||
POSIX handles i.e. when Win native threads call POSIX thread routines
|
||||
(other than pthread_create))
|
||||
pthread_win32_thread_attach_np
|
||||
pthread_win32_thread_detach_np
|
||||
|
||||
---------------------------
|
||||
Static Initializers
|
||||
|
@ -291,19 +297,16 @@ The following functions are implemented:
|
|||
PTHREAD_RWLOCK_INITIALIZER
|
||||
PTHREAD_SPINLOCK_INITIALIZER
|
||||
|
||||
---------------------------
|
||||
Thread-Safe C Runtime Library (macros)
|
||||
---------------------------
|
||||
strtok_r
|
||||
asctime_r
|
||||
ctime_r
|
||||
gmtime_r
|
||||
localtime_r
|
||||
rand_r
|
||||
|
||||
|
||||
The following functions are not implemented:
|
||||
The library includes two non-API functions for creating cancellation
|
||||
points in applications and libraries:
|
||||
|
||||
pthreadCancelableWait
|
||||
pthreadCancelableTimedWait
|
||||
|
||||
|
||||
The following functions are not implemented:
|
||||
|
||||
---------------------------
|
||||
RealTime Scheduling
|
||||
---------------------------
|
||||
|
@ -351,13 +354,17 @@ The following functions are not implemented:
|
|||
---------------------------
|
||||
sysconf
|
||||
|
||||
The library includes two non-API functions for creating cancellation
|
||||
points in applications and libraries:
|
||||
|
||||
pthreadCancelableWait
|
||||
pthreadCancelableTimedWait
|
||||
---------------------------
|
||||
Thread-Safe C Runtime Library (macros)
|
||||
---------------------------
|
||||
strtok_r
|
||||
asctime_r
|
||||
ctime_r
|
||||
gmtime_r
|
||||
localtime_r
|
||||
rand_r
|
||||
|
||||
|
||||
|
||||
Availability
|
||||
------------
|
||||
|
||||
|
@ -407,7 +414,7 @@ Mingw using C setjmp/longjmp works. Distribute pthreadGC.dll with your applicati
|
|||
|
||||
|
||||
Cygwin: (http://sourceware.cygnus.com/cygwin/)
|
||||
Developers using Cygwin will not need pthreads-win32 since it has POSIX threads
|
||||
Developers using Cygwin do not need pthreads-win32 since it has POSIX threads
|
||||
support. Refer to its documentation for details and extent.
|
||||
|
||||
|
||||
|
@ -420,9 +427,9 @@ Generally:
|
|||
For convenience, the following pre-built files are available on the FTP site
|
||||
(see Availability above):
|
||||
|
||||
pthread.h - for POSIX 1c threads
|
||||
semaphore.h - for POSIX 1b semaphores
|
||||
sched.h - for POSIX 1b scheduling
|
||||
pthread.h - for POSIX threads
|
||||
semaphore.h - for POSIX semaphores
|
||||
sched.h - for POSIX scheduling
|
||||
pthreadVCE.dll - built with MSVC++ compiler using C++ EH
|
||||
pthreadVCE.lib
|
||||
pthreadVC.dll - built with MSVC compiler using C setjmp/longjmp
|
|
@ -22,9 +22,17 @@ Known bugs
|
|||
Workaround: avoid using pthread_exit() in C++ applications. Exit
|
||||
threads by dropping through the end of the thread routine.
|
||||
|
||||
2. Cancellation problems in optimised code
|
||||
2. Cancellation problems in C++ builds
|
||||
- Milan Gardian
|
||||
|
||||
[Note: It's not clear if this problem isn't simply due to the context
|
||||
switch in pthread_cancel() which occurs unless the QueueUserAPCEx
|
||||
library and driver are installed and used. Just like setjmp/longjmp,
|
||||
this is probably not going to work well in C++. In any case, unless for
|
||||
some very unusual reason you really must use the C++ build then please
|
||||
use the C build pthreadVC2.dll or pthreadGC2.dll, i.e. for C++
|
||||
applications.]
|
||||
|
||||
This is suspected to be a compiler bug in VC6.0, and also seen in
|
||||
VC7.0 and VS .NET 2003. The GNU C++ compiler does not have a problem
|
||||
with this, and it has been reported that the Intel C++ 8.1 compiler
|
|
@ -0,0 +1,268 @@
|
|||
# This makefile is compatible with BCB make. Use "make -fBMakefile" to compile.
|
||||
#
|
||||
# The variables $DLLDEST and $LIBDEST hold the destination directories for the
|
||||
# dll and the lib, respectively. Probably all that needs to change is $DEVROOT.
|
||||
#
|
||||
# Currently only the recommended pthreadBC.dll is built by this makefile.
|
||||
#
|
||||
|
||||
|
||||
DLL_VER = 2
|
||||
|
||||
DEVROOT = .
|
||||
|
||||
DLLDEST = $(DEVROOT)\DLL
|
||||
LIBDEST = $(DEVROOT)\DLL
|
||||
|
||||
DLLS = pthreadBC$(DLL_VER).dll
|
||||
|
||||
OPTIM = /O2
|
||||
|
||||
RC = brcc32
|
||||
RCFLAGS = -i.
|
||||
|
||||
CFLAGS = /q /I. /D_WIN32_WINNT=0x400 /DHAVE_PTW32_CONFIG_H=1 /4 /tWD /tWM \
|
||||
/w-aus /w-asc /w-par
|
||||
|
||||
#C cleanup code
|
||||
BCFLAGS = $(PTW32_FLAGS) $(CFLAGS)
|
||||
|
||||
# Agregate modules for inlinability
|
||||
DLL_OBJS = \
|
||||
attr.obj \
|
||||
barrier.obj \
|
||||
cancel.obj \
|
||||
cleanup.obj \
|
||||
condvar.obj \
|
||||
create.obj \
|
||||
dll.obj \
|
||||
errno.obj \
|
||||
exit.obj \
|
||||
fork.obj \
|
||||
global.obj \
|
||||
misc.obj \
|
||||
mutex.obj \
|
||||
nonportable.obj \
|
||||
private.obj \
|
||||
rwlock.obj \
|
||||
sched.obj \
|
||||
semaphore.obj \
|
||||
signal.obj \
|
||||
spin.obj \
|
||||
sync.obj \
|
||||
tsd.obj
|
||||
|
||||
INCL = config.h implement.h semaphore.h pthread.h need_errno.h
|
||||
|
||||
ATTR_SRCS = \
|
||||
pthread_attr_init.c \
|
||||
pthread_attr_destroy.c \
|
||||
pthread_attr_getdetachstate.c \
|
||||
pthread_attr_setdetachstate.c \
|
||||
pthread_attr_getstackaddr.c \
|
||||
pthread_attr_setstackaddr.c \
|
||||
pthread_attr_getstacksize.c \
|
||||
pthread_attr_setstacksize.c \
|
||||
pthread_attr_getscope.c \
|
||||
pthread_attr_setscope.c
|
||||
|
||||
BARRIER_SRCS = \
|
||||
pthread_barrier_init.c \
|
||||
pthread_barrier_destroy.c \
|
||||
pthread_barrier_wait.c \
|
||||
pthread_barrierattr_init.c \
|
||||
pthread_barrierattr_destroy.c \
|
||||
pthread_barrierattr_setpshared.c \
|
||||
pthread_barrierattr_getpshared.c
|
||||
|
||||
CANCEL_SRCS = \
|
||||
pthread_setcancelstate.c \
|
||||
pthread_setcanceltype.c \
|
||||
pthread_testcancel.c \
|
||||
pthread_cancel.c
|
||||
|
||||
CONDVAR_SRCS = \
|
||||
ptw32_cond_check_need_init.c \
|
||||
pthread_condattr_destroy.c \
|
||||
pthread_condattr_getpshared.c \
|
||||
pthread_condattr_init.c \
|
||||
pthread_condattr_setpshared.c \
|
||||
pthread_cond_destroy.c \
|
||||
pthread_cond_init.c \
|
||||
pthread_cond_signal.c \
|
||||
pthread_cond_wait.c
|
||||
|
||||
EXIT_SRCS = \
|
||||
pthread_exit.c
|
||||
|
||||
MISC_SRCS = \
|
||||
pthread_equal.c \
|
||||
pthread_getconcurrency.c \
|
||||
pthread_once.c \
|
||||
pthread_self.c \
|
||||
pthread_setconcurrency.c \
|
||||
ptw32_calloc.c \
|
||||
ptw32_MCS_lock.c \
|
||||
ptw32_new.c \
|
||||
w32_CancelableWait.c
|
||||
|
||||
MUTEX_SRCS = \
|
||||
ptw32_mutex_check_need_init.c \
|
||||
pthread_mutex_init.c \
|
||||
pthread_mutex_destroy.c \
|
||||
pthread_mutexattr_init.c \
|
||||
pthread_mutexattr_destroy.c \
|
||||
pthread_mutexattr_getpshared.c \
|
||||
pthread_mutexattr_setpshared.c \
|
||||
pthread_mutexattr_settype.c \
|
||||
pthread_mutexattr_gettype.c \
|
||||
pthread_mutexattr_setrobust.c \
|
||||
pthread_mutexattr_getrobust.c \
|
||||
pthread_mutex_lock.c \
|
||||
pthread_mutex_timedlock.c \
|
||||
pthread_mutex_unlock.c \
|
||||
pthread_mutex_trylock.c \
|
||||
pthread_mutex_consistent.c
|
||||
|
||||
NONPORTABLE_SRCS = \
|
||||
pthread_mutexattr_setkind_np.c \
|
||||
pthread_mutexattr_getkind_np.c \
|
||||
pthread_getw32threadhandle_np.c \
|
||||
pthread_delay_np.c \
|
||||
pthread_num_processors_np.c \
|
||||
pthread_win32_attach_detach_np.c \
|
||||
pthread_timechange_handler_np.c
|
||||
|
||||
PRIVATE_SRCS = \
|
||||
ptw32_is_attr.c \
|
||||
ptw32_processInitialize.c \
|
||||
ptw32_processTerminate.c \
|
||||
ptw32_threadStart.c \
|
||||
ptw32_threadDestroy.c \
|
||||
ptw32_tkAssocCreate.c \
|
||||
ptw32_tkAssocDestroy.c \
|
||||
ptw32_callUserDestroyRoutines.c \
|
||||
ptw32_timespec.c \
|
||||
ptw32_relmillisecs.c \
|
||||
ptw32_throw.c \
|
||||
ptw32_getprocessors.c
|
||||
|
||||
RWLOCK_SRCS = \
|
||||
ptw32_rwlock_check_need_init.c \
|
||||
ptw32_rwlock_cancelwrwait.c \
|
||||
pthread_rwlock_init.c \
|
||||
pthread_rwlock_destroy.c \
|
||||
pthread_rwlockattr_init.c \
|
||||
pthread_rwlockattr_destroy.c \
|
||||
pthread_rwlockattr_getpshared.c \
|
||||
pthread_rwlockattr_setpshared.c \
|
||||
pthread_rwlock_rdlock.c \
|
||||
pthread_rwlock_timedrdlock.c \
|
||||
pthread_rwlock_wrlock.c \
|
||||
pthread_rwlock_timedwrlock.c \
|
||||
pthread_rwlock_unlock.c \
|
||||
pthread_rwlock_tryrdlock.c \
|
||||
pthread_rwlock_trywrlock.c
|
||||
|
||||
SCHED_SRCS = \
|
||||
pthread_attr_setschedpolicy.c \
|
||||
pthread_attr_getschedpolicy.c \
|
||||
pthread_attr_setschedparam.c \
|
||||
pthread_attr_getschedparam.c \
|
||||
pthread_attr_setinheritsched.c \
|
||||
pthread_attr_getinheritsched.c \
|
||||
pthread_setschedparam.c \
|
||||
pthread_getschedparam.c \
|
||||
sched_get_priority_max.c \
|
||||
sched_get_priority_min.c \
|
||||
sched_setscheduler.c \
|
||||
sched_getscheduler.c \
|
||||
sched_yield.c
|
||||
|
||||
SEMAPHORE_SRCS = \
|
||||
sem_init.c \
|
||||
sem_destroy.c \
|
||||
sem_trywait.c \
|
||||
sem_timedwait.c \
|
||||
sem_wait.c \
|
||||
sem_post.c \
|
||||
sem_post_multiple.c \
|
||||
sem_getvalue.c \
|
||||
sem_open.c \
|
||||
sem_close.c \
|
||||
sem_unlink.c
|
||||
|
||||
SPIN_SRCS = \
|
||||
ptw32_spinlock_check_need_init.c \
|
||||
pthread_spin_init.c \
|
||||
pthread_spin_destroy.c \
|
||||
pthread_spin_lock.c \
|
||||
pthread_spin_unlock.c \
|
||||
pthread_spin_trylock.c
|
||||
|
||||
SYNC_SRCS = \
|
||||
pthread_detach.c \
|
||||
pthread_join.c
|
||||
|
||||
TSD_SRCS = \
|
||||
pthread_key_create.c \
|
||||
pthread_key_delete.c \
|
||||
pthread_setspecific.c \
|
||||
pthread_getspecific.c
|
||||
|
||||
|
||||
all: clean $(DLLS)
|
||||
|
||||
realclean: clean
|
||||
if exist pthread*.dll del pthread*.dll
|
||||
if exist pthread*.lib del pthread*.lib
|
||||
if exist *.stamp del *.stamp
|
||||
|
||||
clean:
|
||||
if exist *.obj del *.obj
|
||||
if exist *.ilk del *.ilk
|
||||
if exist *.ilc del *.ilc
|
||||
if exist *.ild del *.ild
|
||||
if exist *.ilf del *.ilf
|
||||
if exist *.ils del *.ils
|
||||
if exist *.tds del *.tds
|
||||
if exist *.pdb del *.pdb
|
||||
if exist *.exp del *.exp
|
||||
if exist *.map del *.map
|
||||
if exist *.o del *.o
|
||||
if exist *.i del *.i
|
||||
if exist *.res del *.res
|
||||
|
||||
|
||||
install: $(DLLS)
|
||||
copy pthread*.dll $(DLLDEST)
|
||||
copy pthread*.lib $(LIBDEST)
|
||||
|
||||
$(DLLS): $(DLL_OBJS) version.res
|
||||
ilink32 /Tpd /Gi c0d32x.obj $(DLL_OBJS), \
|
||||
$@, ,\
|
||||
cw32mti.lib import32.lib, ,\
|
||||
version.res
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(OPTIM) $(BCFLAGS) -c $<
|
||||
|
||||
.rc.res:
|
||||
$(RC) $(RCFLAGS) $<
|
||||
|
||||
attr.obj: attr.c $(ATTR_SRCS) $(INCL)
|
||||
barrier.obj: barrier.c $(BARRIER_SRCS) $(INCL)
|
||||
cancel.obj: cancel.c $(CANCEL_SRCS) $(INCL)
|
||||
condvar.obj: condvar.c $(CONDVAR_SRCS) $(INCL)
|
||||
exit.obj: exit.c $(EXIT_SRCS) $(INCL)
|
||||
misc.obj: misc.c $(MISC_SRCS) $(INCL)
|
||||
mutex.obj: mutex.c $(MUTEX_SRCS) $(INCL)
|
||||
nonportable.obj: nonportable.c $(NONPORTABLE_SRCS) $(INCL)
|
||||
private.obj: private.c $(PRIVATE_SRCS) $(INCL)
|
||||
rwlock.obj: rwlock.c $(RWLOCK_SRCS) $(INCL)
|
||||
sched.obj: sched.c $(SCHED_SRCS) $(INCL)
|
||||
semaphore.obj: semaphore.c $(SEMAPHORE_SRCS) $(INCL)
|
||||
spin.obj: spin.c $(SPIN_SRCS) $(INCL)
|
||||
sync.obj: sync.c $(SYNC_SRCS) $(INCL)
|
||||
tsd.obj: tsd.c $(TSD_SRCS) $(INCL)
|
||||
version.res: version.rc $(INCL)
|
|
@ -7,7 +7,7 @@ Ben Elliston bje at cygnus dot com
|
|||
Initiated the project;
|
||||
setup the project infrastructure (CVS, web page, etc.);
|
||||
early prototype routines.
|
||||
Ross Johnson rpj at callisto dot canberra dot edu dot au
|
||||
Ross Johnson Ross dot Johnson at dot homemail dot com dot au
|
||||
early prototype routines;
|
||||
ongoing project coordination/maintenance;
|
||||
implementation of spin locks and barriers;
|
||||
|
@ -114,6 +114,7 @@ Piet van Bruggen pietvb at newbridges dot nl
|
|||
Makoto Kato raven at oldskool dot jp
|
||||
AMD64 port.
|
||||
Panagiotis E. Hadjidoukas peh at hpclab dot ceid dot upatras dot gr
|
||||
phadjido at cs dot uoi dot gr
|
||||
Contributed the QueueUserAPCEx package which
|
||||
makes preemptive async cancelation possible.
|
||||
Will Bryant will dot bryant at ecosm dot com
|
||||
|
@ -127,3 +128,13 @@ Vladimir Kliatchko vladimir at kliatchko dot com
|
|||
reimplemented pthread_once with the same form
|
||||
as described by A.Terekhov (later version 2);
|
||||
implementation of MCS (Mellor-Crummey/Scott) locks.
|
||||
Ramiro Polla ramiro.polla at gmail dot com
|
||||
static library auto init/cleanup on application
|
||||
start/exit via RT hooks (MSC and GCC compilers only).
|
||||
Daniel Richard G. skunk at iSKUNK dot org
|
||||
Patches and cleanups for x86 and x64, particularly
|
||||
across a range of MS build environments.
|
||||
John Kamp john dot kamp at globalgraphics dot com
|
||||
Patches to fix various problems on x64; brutal testing
|
||||
particularly using high memory run environments.
|
||||
|
|
@ -0,0 +1,504 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This 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.
|
||||
|
||||
This 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 this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -30,6 +30,9 @@ Q 9 Cancelation doesn't work for me, why?
|
|||
Q 10 How do I generate pthreadGCE.dll and libpthreadw32.a for use
|
||||
with Mingw32?
|
||||
|
||||
Q 11 Why isn't pthread_t defined as a scalar (e.g. pointer or int)
|
||||
like it is for other POSIX threads implementations?
|
||||
|
||||
=============================================================================
|
||||
|
||||
Q 1 What is it?
|
||||
|
@ -400,4 +403,49 @@ This should not be a problem with recent versions of MinGW32.
|
|||
For early versions, see Thomas Pfaff's email at:
|
||||
http://sources.redhat.com/ml/pthreads-win32/2002/msg00000.html
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Q 11 Why isn't pthread_t defined as a scalar (e.g. pointer or int)
|
||||
like it is for other POSIX threads implementations?
|
||||
----
|
||||
|
||||
Originally pthread_t was defined as a pointer (to the opaque pthread_t_
|
||||
struct) and later it was changed to a struct containing the original
|
||||
pointer plus a sequence counter. This is allowed under both the original
|
||||
POSIX Threads Standard and the current Single Unix Specification.
|
||||
|
||||
When pthread_t is a simple pointer to a struct some very difficult to
|
||||
debug problems arise from the process of freeing and later allocing
|
||||
thread structs because new pthread_t handles can acquire the identity of
|
||||
previously detached threads. The change to a struct was made, along with
|
||||
some changes to their internal managment, in order to guarantee (for
|
||||
practical applications) that the pthread_t handle will be unique over the
|
||||
life of the running process.
|
||||
|
||||
Where application code attempts to compare one pthread_t against another
|
||||
directly, a compiler error will be emitted because structs can't be
|
||||
compared at that level. This should signal a potentially serious problem
|
||||
in the code design, which would go undetected if pthread_t was a scalar.
|
||||
|
||||
The POSIX Threading API provides a function named pthread_equal() to
|
||||
compare pthread_t thread handles.
|
||||
|
||||
Other pthreads implementations, such as Sun's, use an int as the handle
|
||||
but do guarantee uniqueness within the process scope. Win32 scalar typed
|
||||
thread handles also guarantee uniqueness in system scope. It wasn't clear
|
||||
how well the internal management of these handles would scale as the
|
||||
number of threads and the fragmentation of the sequence numbering
|
||||
increased for applications where thousands or millions of threads are
|
||||
created and detached over time. The current management of threads within
|
||||
pthreads-win32 using structs for pthread_t, and reusing without ever
|
||||
freeing them, reduces the management time overheads to a constant, which
|
||||
could be important given that pthreads-win32 threads are built on top of
|
||||
Win32 threads and will therefore include that management overhead on top
|
||||
of their own. The cost is that the memory resources used for thread
|
||||
handles will remain at the peak level until the process exits.
|
||||
|
||||
While it may be inconvenient for developers to be forced away from making
|
||||
assumptions about the internals of pthread_t, the advantage for the
|
||||
future development of pthread-win32, as well as those applications that
|
||||
use it and other pthread implementations, is that the library is free to
|
||||
change pthread_t internals and management as better methods arise.
|
||||
|
|
@ -0,0 +1,593 @@
|
|||
#
|
||||
# --------------------------------------------------------------------------
|
||||
#
|
||||
# Pthreads-win32 - POSIX Threads Library for Win32
|
||||
# Copyright(C) 1998 John E. Bossom
|
||||
# Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
#
|
||||
# Contact Email: rpj@callisto.canberra.edu.au
|
||||
#
|
||||
# The current list of contributors is contained
|
||||
# in the file CONTRIBUTORS included with the source
|
||||
# code distribution. The list can also be seen at the
|
||||
# following World Wide Web location:
|
||||
# http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
#
|
||||
# This 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 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This 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 this library in the file COPYING.LIB;
|
||||
# if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
#
|
||||
|
||||
DLL_VER = 2
|
||||
DLL_VERD= $(DLL_VER)d
|
||||
|
||||
DEVROOT = C:\PTHREADS
|
||||
|
||||
DLLDEST = $(DEVROOT)\DLL
|
||||
LIBDEST = $(DEVROOT)\DLL
|
||||
|
||||
# If Running MsysDTK
|
||||
RM = rm -f
|
||||
MV = mv -f
|
||||
CP = cp -f
|
||||
|
||||
# If not.
|
||||
#RM = erase
|
||||
#MV = rename
|
||||
#CP = copy
|
||||
|
||||
# For cross compiling use e.g.
|
||||
# make CROSS=x86_64-w64-mingw32- clean GC-inlined
|
||||
CROSS =
|
||||
|
||||
AR = $(CROSS)ar
|
||||
DLLTOOL = $(CROSS)dlltool
|
||||
CC = $(CROSS)gcc
|
||||
CXX = $(CROSS)g++
|
||||
RANLIB = $(CROSS)ranlib
|
||||
RC = $(CROSS)windres
|
||||
|
||||
OPT = $(CLEANUP) -O3 # -finline-functions -findirect-inlining
|
||||
XOPT =
|
||||
|
||||
RCFLAGS = --include-dir=.
|
||||
# Uncomment this if config.h defines RETAIN_WSALASTERROR
|
||||
#LFLAGS = -lws2_32
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# The library can be built with some alternative behaviour to
|
||||
# facilitate development of applications on Win32 that will be ported
|
||||
# to other POSIX systems. Nothing definable here will make the library
|
||||
# non-compliant, but applications that make assumptions that POSIX
|
||||
# does not garrantee may fail or misbehave under some settings.
|
||||
#
|
||||
# PTW32_THREAD_ID_REUSE_INCREMENT
|
||||
# Purpose:
|
||||
# POSIX says that applications should assume that thread IDs can be
|
||||
# recycled. However, Solaris and some other systems use a [very large]
|
||||
# sequence number as the thread ID, which provides virtual uniqueness.
|
||||
# Pthreads-win32 provides pseudo-unique IDs when the default increment
|
||||
# (1) is used, but pthread_t is not a scalar type like Solaris's.
|
||||
#
|
||||
# Usage:
|
||||
# Set to any value in the range: 0 <= value <= 2^wordsize
|
||||
#
|
||||
# Examples:
|
||||
# Set to 0 to emulate non recycle-unique behaviour like Linux or *BSD.
|
||||
# Set to 1 for recycle-unique thread IDs (this is the default).
|
||||
# Set to some other +ve value to emulate smaller word size types
|
||||
# (i.e. will wrap sooner).
|
||||
#
|
||||
#PTW32_FLAGS = "-DPTW32_THREAD_ID_REUSE_INCREMENT=0"
|
||||
#
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
GC_CFLAGS = $(PTW32_FLAGS)
|
||||
GCE_CFLAGS = $(PTW32_FLAGS) -mthreads
|
||||
|
||||
## Mingw
|
||||
MAKE ?= make
|
||||
CFLAGS = $(OPT) $(XOPT) -I. -DHAVE_PTW32_CONFIG_H -Wall
|
||||
|
||||
DLL_INLINED_OBJS = \
|
||||
pthread.o \
|
||||
version.o
|
||||
|
||||
# Agregate modules for inlinability
|
||||
DLL_OBJS = \
|
||||
attr.o \
|
||||
barrier.o \
|
||||
cancel.o \
|
||||
cleanup.o \
|
||||
condvar.o \
|
||||
create.o \
|
||||
dll.o \
|
||||
errno.o \
|
||||
exit.o \
|
||||
fork.o \
|
||||
global.o \
|
||||
misc.o \
|
||||
mutex.o \
|
||||
nonportable.o \
|
||||
private.o \
|
||||
rwlock.o \
|
||||
sched.o \
|
||||
semaphore.o \
|
||||
signal.o \
|
||||
spin.o \
|
||||
sync.o \
|
||||
tsd.o \
|
||||
version.o
|
||||
|
||||
# Separate modules for minimum size statically linked images
|
||||
SMALL_STATIC_OBJS = \
|
||||
pthread_attr_init.o \
|
||||
pthread_attr_destroy.o \
|
||||
pthread_attr_getdetachstate.o \
|
||||
pthread_attr_setdetachstate.o \
|
||||
pthread_attr_getstackaddr.o \
|
||||
pthread_attr_setstackaddr.o \
|
||||
pthread_attr_getstacksize.o \
|
||||
pthread_attr_setstacksize.o \
|
||||
pthread_attr_getscope.o \
|
||||
pthread_attr_setscope.o \
|
||||
pthread_attr_setschedpolicy.o \
|
||||
pthread_attr_getschedpolicy.o \
|
||||
pthread_attr_setschedparam.o \
|
||||
pthread_attr_getschedparam.o \
|
||||
pthread_attr_setinheritsched.o \
|
||||
pthread_attr_getinheritsched.o \
|
||||
pthread_barrier_init.o \
|
||||
pthread_barrier_destroy.o \
|
||||
pthread_barrier_wait.o \
|
||||
pthread_barrierattr_init.o \
|
||||
pthread_barrierattr_destroy.o \
|
||||
pthread_barrierattr_setpshared.o \
|
||||
pthread_barrierattr_getpshared.o \
|
||||
pthread_setcancelstate.o \
|
||||
pthread_setcanceltype.o \
|
||||
pthread_testcancel.o \
|
||||
pthread_cancel.o \
|
||||
cleanup.o \
|
||||
pthread_condattr_destroy.o \
|
||||
pthread_condattr_getpshared.o \
|
||||
pthread_condattr_init.o \
|
||||
pthread_condattr_setpshared.o \
|
||||
pthread_cond_destroy.o \
|
||||
pthread_cond_init.o \
|
||||
pthread_cond_signal.o \
|
||||
pthread_cond_wait.o \
|
||||
create.o \
|
||||
dll.o \
|
||||
autostatic.o \
|
||||
errno.o \
|
||||
pthread_exit.o \
|
||||
fork.o \
|
||||
global.o \
|
||||
pthread_mutex_init.o \
|
||||
pthread_mutex_destroy.o \
|
||||
pthread_mutexattr_init.o \
|
||||
pthread_mutexattr_destroy.o \
|
||||
pthread_mutexattr_getpshared.o \
|
||||
pthread_mutexattr_setpshared.o \
|
||||
pthread_mutexattr_settype.o \
|
||||
pthread_mutexattr_gettype.o \
|
||||
pthread_mutexattr_setrobust.o \
|
||||
pthread_mutexattr_getrobust.o \
|
||||
pthread_mutex_lock.o \
|
||||
pthread_mutex_timedlock.o \
|
||||
pthread_mutex_unlock.o \
|
||||
pthread_mutex_trylock.o \
|
||||
pthread_mutex_consistent.o \
|
||||
pthread_mutexattr_setkind_np.o \
|
||||
pthread_mutexattr_getkind_np.o \
|
||||
pthread_getw32threadhandle_np.o \
|
||||
pthread_getunique_np.o \
|
||||
pthread_delay_np.o \
|
||||
pthread_num_processors_np.o \
|
||||
pthread_win32_attach_detach_np.o \
|
||||
pthread_equal.o \
|
||||
pthread_getconcurrency.o \
|
||||
pthread_once.o \
|
||||
pthread_self.o \
|
||||
pthread_setconcurrency.o \
|
||||
pthread_rwlock_init.o \
|
||||
pthread_rwlock_destroy.o \
|
||||
pthread_rwlockattr_init.o \
|
||||
pthread_rwlockattr_destroy.o \
|
||||
pthread_rwlockattr_getpshared.o \
|
||||
pthread_rwlockattr_setpshared.o \
|
||||
pthread_rwlock_rdlock.o \
|
||||
pthread_rwlock_wrlock.o \
|
||||
pthread_rwlock_unlock.o \
|
||||
pthread_rwlock_tryrdlock.o \
|
||||
pthread_rwlock_trywrlock.o \
|
||||
pthread_setschedparam.o \
|
||||
pthread_getschedparam.o \
|
||||
pthread_timechange_handler_np.o \
|
||||
ptw32_is_attr.o \
|
||||
ptw32_cond_check_need_init.o \
|
||||
ptw32_MCS_lock.o \
|
||||
ptw32_mutex_check_need_init.o \
|
||||
ptw32_processInitialize.o \
|
||||
ptw32_processTerminate.o \
|
||||
ptw32_threadStart.o \
|
||||
ptw32_threadDestroy.o \
|
||||
ptw32_tkAssocCreate.o \
|
||||
ptw32_tkAssocDestroy.o \
|
||||
ptw32_callUserDestroyRoutines.o \
|
||||
ptw32_timespec.o \
|
||||
ptw32_throw.o \
|
||||
ptw32_getprocessors.o \
|
||||
ptw32_calloc.o \
|
||||
ptw32_new.o \
|
||||
ptw32_reuse.o \
|
||||
ptw32_semwait.o \
|
||||
ptw32_relmillisecs.o \
|
||||
ptw32_rwlock_check_need_init.o \
|
||||
sched_get_priority_max.o \
|
||||
sched_get_priority_min.o \
|
||||
sched_setscheduler.o \
|
||||
sched_getscheduler.o \
|
||||
sched_yield.o \
|
||||
sem_init.o \
|
||||
sem_destroy.o \
|
||||
sem_trywait.o \
|
||||
sem_timedwait.o \
|
||||
sem_wait.o \
|
||||
sem_post.o \
|
||||
sem_post_multiple.o \
|
||||
sem_getvalue.o \
|
||||
sem_open.o \
|
||||
sem_close.o \
|
||||
sem_unlink.o \
|
||||
signal.o \
|
||||
pthread_kill.o \
|
||||
ptw32_spinlock_check_need_init.o \
|
||||
pthread_spin_init.o \
|
||||
pthread_spin_destroy.o \
|
||||
pthread_spin_lock.o \
|
||||
pthread_spin_unlock.o \
|
||||
pthread_spin_trylock.o \
|
||||
pthread_detach.o \
|
||||
pthread_join.o \
|
||||
pthread_key_create.o \
|
||||
pthread_key_delete.o \
|
||||
pthread_setspecific.o \
|
||||
pthread_getspecific.o \
|
||||
w32_CancelableWait.o \
|
||||
version.o
|
||||
|
||||
INCL = \
|
||||
config.h \
|
||||
implement.h \
|
||||
semaphore.h \
|
||||
pthread.h \
|
||||
need_errno.h
|
||||
|
||||
ATTR_SRCS = \
|
||||
pthread_attr_init.c \
|
||||
pthread_attr_destroy.c \
|
||||
pthread_attr_getdetachstate.c \
|
||||
pthread_attr_setdetachstate.c \
|
||||
pthread_attr_getstackaddr.c \
|
||||
pthread_attr_setstackaddr.c \
|
||||
pthread_attr_getstacksize.c \
|
||||
pthread_attr_setstacksize.c \
|
||||
pthread_attr_getscope.c \
|
||||
pthread_attr_setscope.c
|
||||
|
||||
BARRIER_SRCS = \
|
||||
pthread_barrier_init.c \
|
||||
pthread_barrier_destroy.c \
|
||||
pthread_barrier_wait.c \
|
||||
pthread_barrierattr_init.c \
|
||||
pthread_barrierattr_destroy.c \
|
||||
pthread_barrierattr_setpshared.c \
|
||||
pthread_barrierattr_getpshared.c
|
||||
|
||||
CANCEL_SRCS = \
|
||||
pthread_setcancelstate.c \
|
||||
pthread_setcanceltype.c \
|
||||
pthread_testcancel.c \
|
||||
pthread_cancel.c
|
||||
|
||||
CONDVAR_SRCS = \
|
||||
ptw32_cond_check_need_init.c \
|
||||
pthread_condattr_destroy.c \
|
||||
pthread_condattr_getpshared.c \
|
||||
pthread_condattr_init.c \
|
||||
pthread_condattr_setpshared.c \
|
||||
pthread_cond_destroy.c \
|
||||
pthread_cond_init.c \
|
||||
pthread_cond_signal.c \
|
||||
pthread_cond_wait.c
|
||||
|
||||
EXIT_SRCS = \
|
||||
pthread_exit.c
|
||||
|
||||
MISC_SRCS = \
|
||||
pthread_equal.c \
|
||||
pthread_getconcurrency.c \
|
||||
pthread_kill.c \
|
||||
pthread_once.c \
|
||||
pthread_self.c \
|
||||
pthread_setconcurrency.c \
|
||||
ptw32_calloc.c \
|
||||
ptw32_MCS_lock.c \
|
||||
ptw32_new.c \
|
||||
ptw32_reuse.c \
|
||||
w32_CancelableWait.c
|
||||
|
||||
MUTEX_SRCS = \
|
||||
ptw32_mutex_check_need_init.c \
|
||||
pthread_mutex_init.c \
|
||||
pthread_mutex_destroy.c \
|
||||
pthread_mutexattr_init.c \
|
||||
pthread_mutexattr_destroy.c \
|
||||
pthread_mutexattr_getpshared.c \
|
||||
pthread_mutexattr_setpshared.c \
|
||||
pthread_mutexattr_settype.c \
|
||||
pthread_mutexattr_gettype.c \
|
||||
pthread_mutexattr_setrobust.c \
|
||||
pthread_mutexattr_getrobust.c \
|
||||
pthread_mutex_lock.c \
|
||||
pthread_mutex_timedlock.c \
|
||||
pthread_mutex_unlock.c \
|
||||
pthread_mutex_trylock.c \
|
||||
pthread_mutex_consistent.c
|
||||
|
||||
NONPORTABLE_SRCS = \
|
||||
pthread_mutexattr_setkind_np.c \
|
||||
pthread_mutexattr_getkind_np.c \
|
||||
pthread_getw32threadhandle_np.c \
|
||||
pthread_getunique_np.c \
|
||||
pthread_delay_np.c \
|
||||
pthread_num_processors_np.c \
|
||||
pthread_win32_attach_detach_np.c \
|
||||
pthread_timechange_handler_np.c
|
||||
|
||||
PRIVATE_SRCS = \
|
||||
ptw32_is_attr.c \
|
||||
ptw32_processInitialize.c \
|
||||
ptw32_processTerminate.c \
|
||||
ptw32_threadStart.c \
|
||||
ptw32_threadDestroy.c \
|
||||
ptw32_tkAssocCreate.c \
|
||||
ptw32_tkAssocDestroy.c \
|
||||
ptw32_callUserDestroyRoutines.c \
|
||||
ptw32_semwait.c \
|
||||
ptw32_relmillisecs.c \
|
||||
ptw32_timespec.c \
|
||||
ptw32_throw.c \
|
||||
ptw32_getprocessors.c
|
||||
|
||||
RWLOCK_SRCS = \
|
||||
ptw32_rwlock_check_need_init.c \
|
||||
ptw32_rwlock_cancelwrwait.c \
|
||||
pthread_rwlock_init.c \
|
||||
pthread_rwlock_destroy.c \
|
||||
pthread_rwlockattr_init.c \
|
||||
pthread_rwlockattr_destroy.c \
|
||||
pthread_rwlockattr_getpshared.c \
|
||||
pthread_rwlockattr_setpshared.c \
|
||||
pthread_rwlock_rdlock.c \
|
||||
pthread_rwlock_timedrdlock.c \
|
||||
pthread_rwlock_wrlock.c \
|
||||
pthread_rwlock_timedwrlock.c \
|
||||
pthread_rwlock_unlock.c \
|
||||
pthread_rwlock_tryrdlock.c \
|
||||
pthread_rwlock_trywrlock.c
|
||||
|
||||
SCHED_SRCS = \
|
||||
pthread_attr_setschedpolicy.c \
|
||||
pthread_attr_getschedpolicy.c \
|
||||
pthread_attr_setschedparam.c \
|
||||
pthread_attr_getschedparam.c \
|
||||
pthread_attr_setinheritsched.c \
|
||||
pthread_attr_getinheritsched.c \
|
||||
pthread_setschedparam.c \
|
||||
pthread_getschedparam.c \
|
||||
sched_get_priority_max.c \
|
||||
sched_get_priority_min.c \
|
||||
sched_setscheduler.c \
|
||||
sched_getscheduler.c \
|
||||
sched_yield.c
|
||||
|
||||
SEMAPHORE_SRCS = \
|
||||
sem_init.c \
|
||||
sem_destroy.c \
|
||||
sem_trywait.c \
|
||||
sem_timedwait.c \
|
||||
sem_wait.c \
|
||||
sem_post.c \
|
||||
sem_post_multiple.c \
|
||||
sem_getvalue.c \
|
||||
sem_open.c \
|
||||
sem_close.c \
|
||||
sem_unlink.c
|
||||
|
||||
SPIN_SRCS = \
|
||||
ptw32_spinlock_check_need_init.c \
|
||||
pthread_spin_init.c \
|
||||
pthread_spin_destroy.c \
|
||||
pthread_spin_lock.c \
|
||||
pthread_spin_unlock.c \
|
||||
pthread_spin_trylock.c
|
||||
|
||||
SYNC_SRCS = \
|
||||
pthread_detach.c \
|
||||
pthread_join.c
|
||||
|
||||
TSD_SRCS = \
|
||||
pthread_key_create.c \
|
||||
pthread_key_delete.c \
|
||||
pthread_setspecific.c \
|
||||
pthread_getspecific.c
|
||||
|
||||
|
||||
GCE_DLL = pthreadGCE$(DLL_VER).dll
|
||||
GCED_DLL= pthreadGCE$(DLL_VERD).dll
|
||||
GCE_LIB = libpthreadGCE$(DLL_VER).a
|
||||
GCED_LIB= libpthreadGCE$(DLL_VERD).a
|
||||
GCE_INLINED_STAMP = pthreadGCE$(DLL_VER).stamp
|
||||
GCED_INLINED_STAMP = pthreadGCE$(DLL_VERD).stamp
|
||||
GCE_STATIC_STAMP = libpthreadGCE$(DLL_VER).stamp
|
||||
GCED_STATIC_STAMP = libpthreadGCE$(DLL_VERD).stamp
|
||||
|
||||
GC_DLL = pthreadGC$(DLL_VER).dll
|
||||
GCD_DLL = pthreadGC$(DLL_VERD).dll
|
||||
GC_LIB = libpthreadGC$(DLL_VER).a
|
||||
GCD_LIB = libpthreadGC$(DLL_VERD).a
|
||||
GC_INLINED_STAMP = pthreadGC$(DLL_VER).stamp
|
||||
GCD_INLINED_STAMP = pthreadGC$(DLL_VERD).stamp
|
||||
GC_STATIC_STAMP = libpthreadGC$(DLL_VER).stamp
|
||||
GCD_STATIC_STAMP = libpthreadGC$(DLL_VERD).stamp
|
||||
|
||||
PTHREAD_DEF = pthread.def
|
||||
|
||||
help:
|
||||
@ echo "Run one of the following command lines:"
|
||||
@ echo "make clean GC (to build the GNU C dll with C cleanup code)"
|
||||
@ echo "make clean GCE (to build the GNU C dll with C++ exception handling)"
|
||||
@ echo "make clean GC-inlined (to build the GNU C inlined dll with C cleanup code)"
|
||||
@ echo "make clean GCE-inlined (to build the GNU C inlined dll with C++ exception handling)"
|
||||
@ echo "make clean GC-static (to build the GNU C inlined static lib with C cleanup code)"
|
||||
@ echo "make clean GC-debug (to build the GNU C debug dll with C cleanup code)"
|
||||
@ echo "make clean GCE-debug (to build the GNU C debug dll with C++ exception handling)"
|
||||
@ echo "make clean GC-inlined-debug (to build the GNU C inlined debug dll with C cleanup code)"
|
||||
@ echo "make clean GCE-inlined-debug (to build the GNU C inlined debug dll with C++ exception handling)"
|
||||
@ echo "make clean GC-static-debug (to build the GNU C inlined static debug lib with C cleanup code)"
|
||||
|
||||
all:
|
||||
@ $(MAKE) clean GCE
|
||||
@ $(MAKE) clean GC
|
||||
|
||||
GC:
|
||||
$(MAKE) CLEANUP=-D__CLEANUP_C XC_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_OBJS)" $(GC_DLL)
|
||||
|
||||
GC-debug:
|
||||
$(MAKE) CLEANUP=-D__CLEANUP_C XC_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_OBJS)" DLL_VER=$(DLL_VERD) OPT="-D__CLEANUP_C -g -O0" $(GCD_DLL)
|
||||
|
||||
GCE:
|
||||
$(MAKE) CC=$(CXX) CLEANUP=-D__CLEANUP_CXX XC_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_OBJS)" $(GCE_DLL)
|
||||
|
||||
GCE-debug:
|
||||
$(MAKE) CC=$(CXX) CLEANUP=-D__CLEANUP_CXX XC_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_OBJS)" DLL_VER=$(DLL_VERD) OPT="-D__CLEANUP_CXX -g -O0" $(GCED_DLL)
|
||||
|
||||
GC-inlined:
|
||||
$(MAKE) XOPT="-DPTW32_BUILD_INLINED" CLEANUP=-D__CLEANUP_C XC_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GC_INLINED_STAMP)
|
||||
|
||||
GC-inlined-debug:
|
||||
$(MAKE) XOPT="-DPTW32_BUILD_INLINED" CLEANUP=-D__CLEANUP_C XC_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" DLL_VER=$(DLL_VERD) OPT="-D__CLEANUP_C -g -O0" $(GCD_INLINED_STAMP)
|
||||
|
||||
GCE-inlined:
|
||||
$(MAKE) CC=$(CXX) XOPT="-DPTW32_BUILD_INLINED" CLEANUP=-D__CLEANUP_CXX XC_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GCE_INLINED_STAMP)
|
||||
|
||||
GCE-inlined-debug:
|
||||
$(MAKE) CC=$(CXX) XOPT="-DPTW32_BUILD_INLINED" CLEANUP=-D__CLEANUP_CXX XC_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" DLL_VER=$(DLL_VERD) OPT="-D__CLEANUP_CXX -g -O0" $(GCED_INLINED_STAMP)
|
||||
|
||||
GC-static:
|
||||
$(MAKE) XOPT="-DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB" CLEANUP=-D__CLEANUP_C XC_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GC_STATIC_STAMP)
|
||||
|
||||
GC-static-debug:
|
||||
$(MAKE) XOPT="-DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB" CLEANUP=-D__CLEANUP_C XC_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" DLL_VER=$(DLL_VERD) OPT="-D__CLEANUP_C -g -O0" $(GCD_STATIC_STAMP)
|
||||
|
||||
tests:
|
||||
@ cd tests
|
||||
@ $(MAKE) auto
|
||||
|
||||
%.pre: %.c
|
||||
$(CC) -E -o $@ $(CFLAGS) $^
|
||||
|
||||
%.s: %.c
|
||||
$(CC) -c $(CFLAGS) -DPTW32_BUILD_INLINED -Wa,-ahl $^ > $@
|
||||
|
||||
%.o: %.rc
|
||||
$(RC) $(RCFLAGS) $(CLEANUP) -o $@ -i $<
|
||||
|
||||
.SUFFIXES: .dll .rc .c .o
|
||||
|
||||
.c.o:; $(CC) -c -o $@ $(CFLAGS) $(XC_FLAGS) $<
|
||||
|
||||
|
||||
$(GC_DLL) $(GCD_DLL): $(DLL_OBJS)
|
||||
$(CC) $(OPT) -shared -o $(GC_DLL) $(DLL_OBJS) $(LFLAGS)
|
||||
$(DLLTOOL) -z pthread.def $(DLL_OBJS)
|
||||
$(DLLTOOL) -k --dllname $@ --output-lib $(GC_LIB) --def $(PTHREAD_DEF)
|
||||
|
||||
$(GCE_DLL): $(DLL_OBJS)
|
||||
$(CC) $(OPT) -mthreads -shared -o $(GCE_DLL) $(DLL_OBJS) $(LFLAGS)
|
||||
$(DLLTOOL) -z pthread.def $(DLL_OBJS)
|
||||
$(DLLTOOL) -k --dllname $@ --output-lib $(GCE_LIB) --def $(PTHREAD_DEF)
|
||||
|
||||
$(GC_INLINED_STAMP) $(GCD_INLINED_STAMP): $(DLL_INLINED_OBJS)
|
||||
$(CC) $(OPT) $(XOPT) -shared -o $(GC_DLL) $(DLL_INLINED_OBJS) $(LFLAGS)
|
||||
$(DLLTOOL) -z pthread.def $(DLL_INLINED_OBJS)
|
||||
$(DLLTOOL) -k --dllname $(GC_DLL) --output-lib $(GC_LIB) --def $(PTHREAD_DEF)
|
||||
echo touched > $(GC_INLINED_STAMP)
|
||||
|
||||
$(GCE_INLINED_STAMP) $(GCED_INLINED_STAMP): $(DLL_INLINED_OBJS)
|
||||
$(CC) $(OPT) $(XOPT) -mthreads -shared -o $(GCE_DLL) $(DLL_INLINED_OBJS) $(LFLAGS)
|
||||
$(DLLTOOL) -z pthread.def $(DLL_INLINED_OBJS)
|
||||
$(DLLTOOL) -k --dllname $(GCE_DLL) --output-lib $(GCE_LIB) --def $(PTHREAD_DEF)
|
||||
echo touched > $(GCE_INLINED_STAMP)
|
||||
|
||||
$(GC_STATIC_STAMP) $(GCD_STATIC_STAMP): $(DLL_INLINED_OBJS)
|
||||
$(RM) $(GC_LIB)
|
||||
$(AR) -rv $(GC_LIB) $(DLL_INLINED_OBJS)
|
||||
$(RANLIB) $(GC_LIB)
|
||||
echo touched > $(GC_STATIC_STAMP)
|
||||
|
||||
clean:
|
||||
-$(RM) *~
|
||||
-$(RM) *.i
|
||||
-$(RM) *.s
|
||||
-$(RM) *.o
|
||||
-$(RM) *.obj
|
||||
-$(RM) *.exe
|
||||
-$(RM) $(PTHREAD_DEF)
|
||||
|
||||
realclean: clean
|
||||
-$(RM) $(GC_LIB)
|
||||
-$(RM) $(GCE_LIB)
|
||||
-$(RM) $(GC_DLL)
|
||||
-$(RM) $(GCE_DLL)
|
||||
-$(RM) $(GC_INLINED_STAMP)
|
||||
-$(RM) $(GCE_INLINED_STAMP)
|
||||
-$(RM) $(GC_STATIC_STAMP)
|
||||
-$(RM) $(GCD_LIB)
|
||||
-$(RM) $(GCED_LIB)
|
||||
-$(RM) $(GCD_DLL)
|
||||
-$(RM) $(GCED_DLL)
|
||||
-$(RM) $(GCD_INLINED_STAMP)
|
||||
-$(RM) $(GCED_INLINED_STAMP)
|
||||
-$(RM) $(GCD_STATIC_STAMP)
|
||||
|
||||
attr.o: attr.c $(ATTR_SRCS) $(INCL)
|
||||
barrier.o: barrier.c $(BARRIER_SRCS) $(INCL)
|
||||
cancel.o: cancel.c $(CANCEL_SRCS) $(INCL)
|
||||
condvar.o: condvar.c $(CONDVAR_SRCS) $(INCL)
|
||||
exit.o: exit.c $(EXIT_SRCS) $(INCL)
|
||||
misc.o: misc.c $(MISC_SRCS) $(INCL)
|
||||
mutex.o: mutex.c $(MUTEX_SRCS) $(INCL)
|
||||
nonportable.o: nonportable.c $(NONPORTABLE_SRCS) $(INCL)
|
||||
private.o: private.c $(PRIVATE_SRCS) $(INCL)
|
||||
rwlock.o: rwlock.c $(RWLOCK_SRCS) $(INCL)
|
||||
sched.o: sched.c $(SCHED_SRCS) $(INCL)
|
||||
semaphore.o: semaphore.c $(SEMAPHORE_SRCS) $(INCL)
|
||||
spin.o: spin.c $(SPIN_SRCS) $(INCL)
|
||||
sync.o: sync.c $(SYNC_SRCS) $(INCL)
|
||||
tsd.o: tsd.c $(TSD_SRCS) $(INCL)
|
||||
version.o: version.rc $(INCL)
|
|
@ -0,0 +1,514 @@
|
|||
# This makefile is compatible with MS nmake and can be used as a
|
||||
# replacement for buildlib.bat. I've changed the target from an ordinary dll
|
||||
# (/LD) to a debugging dll (/LDd).
|
||||
#
|
||||
# The variables $DLLDEST and $LIBDEST hold the destination directories for the
|
||||
# dll and the lib, respectively. Probably all that needs to change is $DEVROOT.
|
||||
|
||||
|
||||
# DLL_VER:
|
||||
# See pthread.h and README - This number is computed as 'current - age'
|
||||
DLL_VER = 2
|
||||
DLL_VERD= $(DLL_VER)d
|
||||
|
||||
DEVROOT = C:\pthreads
|
||||
|
||||
DLLDEST = $(DEVROOT)\dll
|
||||
LIBDEST = $(DEVROOT)\lib
|
||||
HDRDEST = $(DEVROOT)\include
|
||||
|
||||
DLLS = pthreadVCE$(DLL_VER).dll pthreadVSE$(DLL_VER).dll pthreadVC$(DLL_VER).dll \
|
||||
pthreadVCE$(DLL_VERD).dll pthreadVSE$(DLL_VERD).dll pthreadVC$(DLL_VERD).dll
|
||||
INLINED_STAMPS = pthreadVCE$(DLL_VER).stamp pthreadVSE$(DLL_VER).stamp pthreadVC$(DLL_VER).stamp \
|
||||
pthreadVCE$(DLL_VERD).stamp pthreadVSE$(DLL_VERD).stamp pthreadVC$(DLL_VERD).stamp
|
||||
STATIC_STAMPS = pthreadVCE$(DLL_VER).static pthreadVSE$(DLL_VER).static pthreadVC$(DLL_VER).static \
|
||||
pthreadVCE$(DLL_VERD).static pthreadVSE$(DLL_VERD).static pthreadVC$(DLL_VERD).static
|
||||
|
||||
CC = cl
|
||||
CPPFLAGS = /I. /DHAVE_PTW32_CONFIG_H
|
||||
XCFLAGS = /W3 /MD /nologo
|
||||
CFLAGS = /O2 /Ob2 $(XCFLAGS)
|
||||
CFLAGSD = /Z7 $(XCFLAGS)
|
||||
|
||||
# Uncomment this if config.h defines RETAIN_WSALASTERROR
|
||||
#XLIBS = wsock32.lib
|
||||
|
||||
# Default cleanup style
|
||||
CLEANUP = __CLEANUP_C
|
||||
|
||||
# C++ Exceptions
|
||||
VCEFLAGS = /EHsc /TP $(CPPFLAGS) $(CFLAGS)
|
||||
VCEFLAGSD = /EHsc /TP $(CPPFLAGS) $(CFLAGSD)
|
||||
#Structured Exceptions
|
||||
VSEFLAGS = $(CPPFLAGS) $(CFLAGS)
|
||||
VSEFLAGSD = $(CPPFLAGS) $(CFLAGSD)
|
||||
#C cleanup code
|
||||
VCFLAGS = $(CPPFLAGS) $(CFLAGS)
|
||||
VCFLAGSD = $(CPPFLAGS) $(CFLAGSD)
|
||||
|
||||
DLL_INLINED_OBJS = \
|
||||
pthread.obj \
|
||||
version.res
|
||||
|
||||
# Aggregate modules for inlinability
|
||||
DLL_OBJS = \
|
||||
attr.obj \
|
||||
barrier.obj \
|
||||
cancel.obj \
|
||||
cleanup.obj \
|
||||
condvar.obj \
|
||||
create.obj \
|
||||
dll.obj \
|
||||
autostatic.obj \
|
||||
errno.obj \
|
||||
exit.obj \
|
||||
fork.obj \
|
||||
global.obj \
|
||||
misc.obj \
|
||||
mutex.obj \
|
||||
nonportable.obj \
|
||||
private.obj \
|
||||
rwlock.obj \
|
||||
sched.obj \
|
||||
semaphore.obj \
|
||||
signal.obj \
|
||||
spin.obj \
|
||||
sync.obj \
|
||||
tsd.obj \
|
||||
version.res
|
||||
|
||||
# Separate modules for minimising the size of statically linked images
|
||||
SMALL_STATIC_OBJS = \
|
||||
pthread_attr_init.obj \
|
||||
pthread_attr_destroy.obj \
|
||||
pthread_attr_getdetachstate.obj \
|
||||
pthread_attr_setdetachstate.obj \
|
||||
pthread_attr_getstackaddr.obj \
|
||||
pthread_attr_setstackaddr.obj \
|
||||
pthread_attr_getstacksize.obj \
|
||||
pthread_attr_setstacksize.obj \
|
||||
pthread_attr_getscope.obj \
|
||||
pthread_attr_setscope.obj \
|
||||
pthread_attr_setschedpolicy.obj \
|
||||
pthread_attr_getschedpolicy.obj \
|
||||
pthread_attr_setschedparam.obj \
|
||||
pthread_attr_getschedparam.obj \
|
||||
pthread_attr_setinheritsched.obj \
|
||||
pthread_attr_getinheritsched.obj \
|
||||
pthread_barrier_init.obj \
|
||||
pthread_barrier_destroy.obj \
|
||||
pthread_barrier_wait.obj \
|
||||
pthread_barrierattr_init.obj \
|
||||
pthread_barrierattr_destroy.obj \
|
||||
pthread_barrierattr_setpshared.obj \
|
||||
pthread_barrierattr_getpshared.obj \
|
||||
pthread_setcancelstate.obj \
|
||||
pthread_setcanceltype.obj \
|
||||
pthread_testcancel.obj \
|
||||
pthread_cancel.obj \
|
||||
cleanup.obj \
|
||||
pthread_condattr_destroy.obj \
|
||||
pthread_condattr_getpshared.obj \
|
||||
pthread_condattr_init.obj \
|
||||
pthread_condattr_setpshared.obj \
|
||||
pthread_cond_destroy.obj \
|
||||
pthread_cond_init.obj \
|
||||
pthread_cond_signal.obj \
|
||||
pthread_cond_wait.obj \
|
||||
create.obj \
|
||||
dll.obj \
|
||||
autostatic.obj \
|
||||
errno.obj \
|
||||
pthread_exit.obj \
|
||||
fork.obj \
|
||||
global.obj \
|
||||
pthread_mutex_init.obj \
|
||||
pthread_mutex_destroy.obj \
|
||||
pthread_mutexattr_init.obj \
|
||||
pthread_mutexattr_destroy.obj \
|
||||
pthread_mutexattr_getpshared.obj \
|
||||
pthread_mutexattr_setpshared.obj \
|
||||
pthread_mutexattr_settype.obj \
|
||||
pthread_mutexattr_gettype.obj \
|
||||
pthread_mutexattr_setrobust.obj \
|
||||
pthread_mutexattr_getrobust.obj \
|
||||
pthread_mutex_lock.obj \
|
||||
pthread_mutex_timedlock.obj \
|
||||
pthread_mutex_unlock.obj \
|
||||
pthread_mutex_trylock.obj \
|
||||
pthread_mutex_consistent.obj \
|
||||
pthread_mutexattr_setkind_np.obj \
|
||||
pthread_mutexattr_getkind_np.obj \
|
||||
pthread_getw32threadhandle_np.obj \
|
||||
pthread_getunique_np.obj \
|
||||
pthread_delay_np.obj \
|
||||
pthread_num_processors_np.obj \
|
||||
pthread_win32_attach_detach_np.obj \
|
||||
pthread_equal.obj \
|
||||
pthread_getconcurrency.obj \
|
||||
pthread_once.obj \
|
||||
pthread_self.obj \
|
||||
pthread_setconcurrency.obj \
|
||||
pthread_rwlock_init.obj \
|
||||
pthread_rwlock_destroy.obj \
|
||||
pthread_rwlockattr_init.obj \
|
||||
pthread_rwlockattr_destroy.obj \
|
||||
pthread_rwlockattr_getpshared.obj \
|
||||
pthread_rwlockattr_setpshared.obj \
|
||||
pthread_rwlock_rdlock.obj \
|
||||
pthread_rwlock_wrlock.obj \
|
||||
pthread_rwlock_unlock.obj \
|
||||
pthread_rwlock_tryrdlock.obj \
|
||||
pthread_rwlock_trywrlock.obj \
|
||||
pthread_setschedparam.obj \
|
||||
pthread_getschedparam.obj \
|
||||
pthread_timechange_handler_np.obj \
|
||||
ptw32_is_attr.obj \
|
||||
ptw32_processInitialize.obj \
|
||||
ptw32_processTerminate.obj \
|
||||
ptw32_threadStart.obj \
|
||||
ptw32_threadDestroy.obj \
|
||||
ptw32_tkAssocCreate.obj \
|
||||
ptw32_tkAssocDestroy.obj \
|
||||
ptw32_callUserDestroyRoutines.obj \
|
||||
ptw32_timespec.obj \
|
||||
ptw32_throw.obj \
|
||||
ptw32_getprocessors.obj \
|
||||
ptw32_calloc.obj \
|
||||
ptw32_new.obj \
|
||||
ptw32_reuse.obj \
|
||||
ptw32_rwlock_check_need_init.obj \
|
||||
ptw32_cond_check_need_init.obj \
|
||||
ptw32_mutex_check_need_init.obj \
|
||||
ptw32_semwait.obj \
|
||||
ptw32_relmillisecs.obj \
|
||||
ptw32_MCS_lock.obj \
|
||||
sched_get_priority_max.obj \
|
||||
sched_get_priority_min.obj \
|
||||
sched_setscheduler.obj \
|
||||
sched_getscheduler.obj \
|
||||
sched_yield.obj \
|
||||
sem_init.obj \
|
||||
sem_destroy.obj \
|
||||
sem_trywait.obj \
|
||||
sem_timedwait.obj \
|
||||
sem_wait.obj \
|
||||
sem_post.obj \
|
||||
sem_post_multiple.obj \
|
||||
sem_getvalue.obj \
|
||||
sem_open.obj \
|
||||
sem_close.obj \
|
||||
sem_unlink.obj \
|
||||
signal.obj \
|
||||
pthread_kill.obj \
|
||||
ptw32_spinlock_check_need_init.obj \
|
||||
pthread_spin_init.obj \
|
||||
pthread_spin_destroy.obj \
|
||||
pthread_spin_lock.obj \
|
||||
pthread_spin_unlock.obj \
|
||||
pthread_spin_trylock.obj \
|
||||
pthread_detach.obj \
|
||||
pthread_join.obj \
|
||||
pthread_key_create.obj \
|
||||
pthread_key_delete.obj \
|
||||
pthread_setspecific.obj \
|
||||
pthread_getspecific.obj \
|
||||
w32_CancelableWait.obj \
|
||||
version.res
|
||||
|
||||
INCL = config.h implement.h semaphore.h pthread.h need_errno.h
|
||||
|
||||
ATTR_SRCS = \
|
||||
pthread_attr_init.c \
|
||||
pthread_attr_destroy.c \
|
||||
pthread_attr_getdetachstate.c \
|
||||
pthread_attr_setdetachstate.c \
|
||||
pthread_attr_getstackaddr.c \
|
||||
pthread_attr_setstackaddr.c \
|
||||
pthread_attr_getstacksize.c \
|
||||
pthread_attr_setstacksize.c \
|
||||
pthread_attr_getscope.c \
|
||||
pthread_attr_setscope.c
|
||||
|
||||
BARRIER_SRCS = \
|
||||
pthread_barrier_init.c \
|
||||
pthread_barrier_destroy.c \
|
||||
pthread_barrier_wait.c \
|
||||
pthread_barrierattr_init.c \
|
||||
pthread_barrierattr_destroy.c \
|
||||
pthread_barrierattr_setpshared.c \
|
||||
pthread_barrierattr_getpshared.c
|
||||
|
||||
CANCEL_SRCS = \
|
||||
pthread_setcancelstate.c \
|
||||
pthread_setcanceltype.c \
|
||||
pthread_testcancel.c \
|
||||
pthread_cancel.c
|
||||
|
||||
CONDVAR_SRCS = \
|
||||
ptw32_cond_check_need_init.c \
|
||||
pthread_condattr_destroy.c \
|
||||
pthread_condattr_getpshared.c \
|
||||
pthread_condattr_init.c \
|
||||
pthread_condattr_setpshared.c \
|
||||
pthread_cond_destroy.c \
|
||||
pthread_cond_init.c \
|
||||
pthread_cond_signal.c \
|
||||
pthread_cond_wait.c
|
||||
|
||||
EXIT_SRCS = \
|
||||
pthread_exit.c
|
||||
|
||||
MISC_SRCS = \
|
||||
pthread_equal.c \
|
||||
pthread_getconcurrency.c \
|
||||
pthread_kill.c \
|
||||
pthread_once.c \
|
||||
pthread_self.c \
|
||||
pthread_setconcurrency.c \
|
||||
ptw32_calloc.c \
|
||||
ptw32_MCS_lock.c \
|
||||
ptw32_new.c \
|
||||
ptw32_reuse.c \
|
||||
ptw32_relmillisecs.c \
|
||||
w32_CancelableWait.c
|
||||
|
||||
MUTEX_SRCS = \
|
||||
ptw32_mutex_check_need_init.c \
|
||||
pthread_mutex_init.c \
|
||||
pthread_mutex_destroy.c \
|
||||
pthread_mutexattr_init.c \
|
||||
pthread_mutexattr_destroy.c \
|
||||
pthread_mutexattr_getpshared.c \
|
||||
pthread_mutexattr_setpshared.c \
|
||||
pthread_mutexattr_settype.c \
|
||||
pthread_mutexattr_gettype.c \
|
||||
pthread_mutexattr_setrobust.c \
|
||||
pthread_mutexattr_getrobust.c \
|
||||
pthread_mutex_lock.c \
|
||||
pthread_mutex_timedlock.c \
|
||||
pthread_mutex_unlock.c \
|
||||
pthread_mutex_trylock.c \
|
||||
pthread_mutex_consistent.c
|
||||
|
||||
NONPORTABLE_SRCS = \
|
||||
pthread_mutexattr_setkind_np.c \
|
||||
pthread_mutexattr_getkind_np.c \
|
||||
pthread_getw32threadhandle_np.c \
|
||||
pthread_getunique_np.c \
|
||||
pthread_delay_np.c \
|
||||
pthread_num_processors_np.c \
|
||||
pthread_win32_attach_detach_np.c \
|
||||
pthread_timechange_handler_np.c
|
||||
|
||||
PRIVATE_SRCS = \
|
||||
ptw32_is_attr.c \
|
||||
ptw32_processInitialize.c \
|
||||
ptw32_processTerminate.c \
|
||||
ptw32_threadStart.c \
|
||||
ptw32_threadDestroy.c \
|
||||
ptw32_tkAssocCreate.c \
|
||||
ptw32_tkAssocDestroy.c \
|
||||
ptw32_callUserDestroyRoutines.c \
|
||||
ptw32_semwait.c \
|
||||
ptw32_timespec.c \
|
||||
ptw32_throw.c \
|
||||
ptw32_getprocessors.c
|
||||
|
||||
RWLOCK_SRCS = \
|
||||
ptw32_rwlock_check_need_init.c \
|
||||
ptw32_rwlock_cancelwrwait.c \
|
||||
pthread_rwlock_init.c \
|
||||
pthread_rwlock_destroy.c \
|
||||
pthread_rwlockattr_init.c \
|
||||
pthread_rwlockattr_destroy.c \
|
||||
pthread_rwlockattr_getpshared.c \
|
||||
pthread_rwlockattr_setpshared.c \
|
||||
pthread_rwlock_rdlock.c \
|
||||
pthread_rwlock_timedrdlock.c \
|
||||
pthread_rwlock_wrlock.c \
|
||||
pthread_rwlock_timedwrlock.c \
|
||||
pthread_rwlock_unlock.c \
|
||||
pthread_rwlock_tryrdlock.c \
|
||||
pthread_rwlock_trywrlock.c
|
||||
|
||||
SCHED_SRCS = \
|
||||
pthread_attr_setschedpolicy.c \
|
||||
pthread_attr_getschedpolicy.c \
|
||||
pthread_attr_setschedparam.c \
|
||||
pthread_attr_getschedparam.c \
|
||||
pthread_attr_setinheritsched.c \
|
||||
pthread_attr_getinheritsched.c \
|
||||
pthread_setschedparam.c \
|
||||
pthread_getschedparam.c \
|
||||
sched_get_priority_max.c \
|
||||
sched_get_priority_min.c \
|
||||
sched_setscheduler.c \
|
||||
sched_getscheduler.c \
|
||||
sched_yield.c
|
||||
|
||||
SEMAPHORE_SRCS = \
|
||||
sem_init.c \
|
||||
sem_destroy.c \
|
||||
sem_trywait.c \
|
||||
sem_timedwait.c \
|
||||
sem_wait.c \
|
||||
sem_post.c \
|
||||
sem_post_multiple.c \
|
||||
sem_getvalue.c \
|
||||
sem_open.c \
|
||||
sem_close.c \
|
||||
sem_unlink.c
|
||||
|
||||
SPIN_SRCS = \
|
||||
ptw32_spinlock_check_need_init.c \
|
||||
pthread_spin_init.c \
|
||||
pthread_spin_destroy.c \
|
||||
pthread_spin_lock.c \
|
||||
pthread_spin_unlock.c \
|
||||
pthread_spin_trylock.c
|
||||
|
||||
SYNC_SRCS = \
|
||||
pthread_detach.c \
|
||||
pthread_join.c
|
||||
|
||||
TSD_SRCS = \
|
||||
pthread_key_create.c \
|
||||
pthread_key_delete.c \
|
||||
pthread_setspecific.c \
|
||||
pthread_getspecific.c
|
||||
|
||||
|
||||
help:
|
||||
@ echo Run one of the following command lines:
|
||||
@ echo nmake clean VCE (to build the MSVC dll with C++ exception handling)
|
||||
@ echo nmake clean VSE (to build the MSVC dll with structured exception handling)
|
||||
@ echo nmake clean VC (to build the MSVC dll with C cleanup code)
|
||||
@ echo nmake clean VCE-inlined (to build the MSVC inlined dll with C++ exception handling)
|
||||
@ echo nmake clean VSE-inlined (to build the MSVC inlined dll with structured exception handling)
|
||||
@ echo nmake clean VC-inlined (to build the MSVC inlined dll with C cleanup code)
|
||||
@ echo nmake clean VC-static (to build the MSVC static lib with C cleanup code)
|
||||
@ echo nmake clean VCE-debug (to build the debug MSVC dll with C++ exception handling)
|
||||
@ echo nmake clean VSE-debug (to build the debug MSVC dll with structured exception handling)
|
||||
@ echo nmake clean VC-debug (to build the debug MSVC dll with C cleanup code)
|
||||
@ echo nmake clean VCE-inlined-debug (to build the debug MSVC inlined dll with C++ exception handling)
|
||||
@ echo nmake clean VSE-inlined-debug (to build the debug MSVC inlined dll with structured exception handling)
|
||||
@ echo nmake clean VC-inlined-debug (to build the debug MSVC inlined dll with C cleanup code)
|
||||
@ echo nmake clean VC-static-debug (to build the debug MSVC static lib with C cleanup code)
|
||||
|
||||
all:
|
||||
@ $(MAKE) /E clean VCE-inlined
|
||||
@ $(MAKE) /E clean VSE-inlined
|
||||
@ $(MAKE) /E clean VC-inlined
|
||||
@ $(MAKE) /E clean VCE-inlined-debug
|
||||
@ $(MAKE) /E clean VSE-inlined-debug
|
||||
@ $(MAKE) /E clean VC-inlined-debug
|
||||
|
||||
VCE:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCEFLAGS)" CLEANUP=__CLEANUP_CXX pthreadVCE$(DLL_VER).dll
|
||||
|
||||
VCE-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCEFLAGSD)" CLEANUP=__CLEANUP_CXX pthreadVCE$(DLL_VERD).dll
|
||||
|
||||
VSE:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VSEFLAGS)" CLEANUP=__CLEANUP_SEH pthreadVSE$(DLL_VER).dll
|
||||
|
||||
VSE-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VSEFLAGSD)" CLEANUP=__CLEANUP_SEH pthreadVSE$(DLL_VERD).dll
|
||||
|
||||
VC:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGS)" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VER).dll
|
||||
|
||||
VC-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGSD)" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VERD).dll
|
||||
|
||||
#
|
||||
# The so-called inlined DLL is just a single translation unit with
|
||||
# inlining optimisation turned on.
|
||||
#
|
||||
VCE-inlined:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCEFLAGS) /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_CXX pthreadVCE$(DLL_VER).stamp
|
||||
|
||||
VCE-inlined-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCEFLAGSD) /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_CXX pthreadVCE$(DLL_VERD).stamp
|
||||
|
||||
VSE-inlined:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VSEFLAGS) /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_SEH pthreadVSE$(DLL_VER).stamp
|
||||
|
||||
VSE-inlined-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VSEFLAGSD) /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_SEH pthreadVSE$(DLL_VERD).stamp
|
||||
|
||||
VC-inlined:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGS) /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VER).stamp
|
||||
|
||||
VC-inlined-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGSD) /DPTW32_BUILD_INLINED" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VERD).stamp
|
||||
|
||||
VC-static:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGS) /DPTW32_BUILD_INLINED /DPTW32_STATIC_LIB" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VER).static
|
||||
|
||||
VC-static-debug:
|
||||
@ $(MAKE) /E /nologo EHFLAGS="$(VCFLAGSD) /DPTW32_BUILD_INLINED /DPTW32_STATIC_LIB" CLEANUP=__CLEANUP_C pthreadVC$(DLL_VERD).static
|
||||
|
||||
realclean: clean
|
||||
if exist pthread*.dll del pthread*.dll
|
||||
if exist pthread*.lib del pthread*.lib
|
||||
if exist *.manifest del *.manifest
|
||||
if exist *.stamp del *.stamp
|
||||
|
||||
clean:
|
||||
if exist *.obj del *.obj
|
||||
if exist *.def del *.def
|
||||
if exist *.ilk del *.ilk
|
||||
if exist *.pdb del *.pdb
|
||||
if exist *.exp del *.exp
|
||||
if exist *.map del *.map
|
||||
if exist *.o del *.o
|
||||
if exist *.i del *.i
|
||||
if exist *.res del *.res
|
||||
|
||||
|
||||
install:
|
||||
copy pthread*.dll $(DLLDEST)
|
||||
copy pthread*.lib $(LIBDEST)
|
||||
copy pthread.h $(HDRDEST)
|
||||
copy sched.h $(HDRDEST)
|
||||
copy semaphore.h $(HDRDEST)
|
||||
|
||||
$(DLLS): $(DLL_OBJS)
|
||||
$(CC) /LDd /Zi /nologo $(DLL_OBJS) /link /implib:$*.lib $(XLIBS) /out:$@
|
||||
|
||||
$(INLINED_STAMPS): $(DLL_INLINED_OBJS)
|
||||
$(CC) /LDd /Zi /nologo $(DLL_INLINED_OBJS) /link /implib:$*.lib $(XLIBS) /out:$*.dll
|
||||
|
||||
$(STATIC_STAMPS): $(DLL_INLINED_OBJS)
|
||||
if exist $*.lib del $*.lib
|
||||
lib $(DLL_INLINED_OBJS) /out:$*.lib
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(EHFLAGS) /D$(CLEANUP) -c $<
|
||||
|
||||
# TARGET_CPU is an environment variable set by Visual Studio Command Prompt
|
||||
# as provided by the SDK
|
||||
.rc.res:
|
||||
rc /dPTW32_ARCH$(TARGET_CPU) /dPTW32_RC_MSC /d$(CLEANUP) $<
|
||||
|
||||
.c.i:
|
||||
$(CC) /P /O2 /Ob1 $(VCFLAGS) $<
|
||||
|
||||
attr.obj: attr.c $(ATTR_SRCS) $(INCL)
|
||||
barrier.obj: barrier.c $(BARRIER_SRCS) $(INCL)
|
||||
cancel.obj: cancel.c $(CANCEL_SRCS) $(INCL)
|
||||
condvar.obj: condvar.c $(CONDVAR_SRCS) $(INCL)
|
||||
exit.obj: exit.c $(EXIT_SRCS) $(INCL)
|
||||
misc.obj: misc.c $(MISC_SRCS) $(INCL)
|
||||
mutex.obj: mutex.c $(MUTEX_SRCS) $(INCL)
|
||||
nonportable.obj: nonportable.c $(NONPORTABLE_SRCS) $(INCL)
|
||||
private.obj: private.c $(PRIVATE_SRCS) $(INCL)
|
||||
rwlock.obj: rwlock.c $(RWLOCK_SRCS) $(INCL)
|
||||
sched.obj: sched.c $(SCHED_SRCS) $(INCL)
|
||||
semaphore.obj: semaphore.c $(SEMAPHORE_SRCS) $(INCL)
|
||||
spin.obj: spin.c $(SPIN_SRCS) $(INCL)
|
||||
sync.obj: sync.c $(SYNC_SRCS) $(INCL)
|
||||
tsd.obj: tsd.c $(TSD_SRCS) $(INCL)
|
||||
version.res: version.rc $(INCL)
|
|
@ -1,3 +1,134 @@
|
|||
RELEASE 2.9.0
|
||||
-------------
|
||||
(2012-05-25)
|
||||
|
||||
General
|
||||
-------
|
||||
New bug fixes in this release since 2.8.0 have NOT been applied to the
|
||||
1.x.x series.
|
||||
|
||||
Some changes post 2011-02-26 in CVS may not be compatible with pre
|
||||
Windows 2000 systems.
|
||||
|
||||
Use of other than the "C" version of the library is now discouraged.
|
||||
That is, the "C++" version fails some tests and does not provide any
|
||||
additional functionality.
|
||||
|
||||
Testing and verification
|
||||
------------------------
|
||||
This version has been tested on SMP architecture (Intel x64 Hex Core)
|
||||
by completing the included test suite, stress and bench tests.
|
||||
|
||||
New Features
|
||||
------------
|
||||
DLL properties now properly includes the target architecture, i.e.
|
||||
right-click on the file pthreadVC2.dll in explorer and choose the Detail
|
||||
tab will show the compiler and architecture in the description field, e.g.
|
||||
"MS C x64" or "MS C x86".
|
||||
- Ross Johnson
|
||||
|
||||
(MSC and GNU builds) The statically linked library now automatically
|
||||
initialises and cleans up on program start/exit, i.e. statically linked
|
||||
applications need not call the routines pthread_win32_process_attach_np()
|
||||
and pthread_win32_process_detach_np() explicitly. The per-thread routine
|
||||
pthread_win32_thread_detach_np() is also called at program exit to cleanup
|
||||
POSIX resources acquired by the primary Windows native thread, if I (RJ)
|
||||
understand the process correctly. Other Windows native threads that call
|
||||
POSIX API routines may need to call the thread detach routine on thread
|
||||
exit if the application depends on reclaimed POSIX resources or running
|
||||
POSIX TSD (TLS) destructors.
|
||||
See README.NONPORTABLE for descriptions of these routines.
|
||||
- Ramiro Polla
|
||||
|
||||
Robust mutexes are implemented within the PROCESS_PRIVATE scope. NOTE that
|
||||
pthread_mutex_* functions may return different error codes for robust
|
||||
mutexes than they otherwise do in normal usage, e.g. pthread_mutex_unlock
|
||||
is required to check ownership for all mutex types when the mutex is
|
||||
robust, whereas this does not occur for the "normal" non-robust mutex type.
|
||||
- Ross Johnson
|
||||
|
||||
pthread_getunique_np is implemented for source level compatibility
|
||||
with some other implementations. This routine returns a 64 bit
|
||||
sequence number that is uniquely associated with a thread. It can be
|
||||
used by applications to order or hash POSIX thread handles.
|
||||
- Ross Johnson
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
Many more changes for 64 bit systems.
|
||||
- Kai Tietz
|
||||
|
||||
Various modifications and fixes to build and test for WinCE.
|
||||
- Marcel Ruff, Sinan Kaya
|
||||
|
||||
Fix pthread_cond_destroy() - should not be a cancellation point. Other
|
||||
minor build problems fixed.
|
||||
- Romano Paolo Tenca
|
||||
|
||||
Remove potential deadlock condition from pthread_cond_destroy().
|
||||
- Eric Berge
|
||||
|
||||
Various modifications to build and test for Win64.
|
||||
- Kip Streithorst
|
||||
|
||||
Various fixes to the QueueUserAPCEx async cancellation helper DLL
|
||||
(this is a separate download) and pthreads code cleanups.
|
||||
- Sebastian Gottschalk
|
||||
|
||||
Removed potential NULL pointer reference.
|
||||
- Robert Kindred
|
||||
|
||||
Removed the requirement that applications restrict the number of threads
|
||||
calling pthread_barrier_wait to just the barrier count. Also reduced the
|
||||
contention between barrier_wait and barrier_destroy. This change will have
|
||||
slowed barriers down slightly but halves the number of semaphores consumed
|
||||
per barrier to one.
|
||||
- Ross Johnson
|
||||
|
||||
Fixed a handle leak in sched_[gs]etscheduler.
|
||||
- Mark Pizzolato
|
||||
|
||||
Removed all of the POSIX re-entrant function compatibility macros from pthread.h.
|
||||
Some were simply not semanticly correct.
|
||||
- Igor Lubashev
|
||||
|
||||
Threads no longer attempt to pass uncaught exceptions out of thread scope (C++
|
||||
and SEH builds only). Uncaught exceptions now cause the thread to exit with
|
||||
the return code PTHREAD_CANCELED.
|
||||
- Ross Johnson
|
||||
|
||||
Lots of casting fixes particularly for x64, Interlocked fixes and reworking
|
||||
for x64.
|
||||
- Daniel Richard G., John Kamp
|
||||
|
||||
Other changes
|
||||
-------------
|
||||
Dependence on the winsock library is now discretionary via
|
||||
#define RETAIN_WSALASTERROR in config.h. It is undefined by default unless
|
||||
WINCE is defined (because RJ is unsure of the dependency there).
|
||||
- Ramiro Polla
|
||||
|
||||
Several static POSIX mutexes used for internal management were replaced by
|
||||
MCS queue-based locks to reduce resource consumption, in particular use of Win32
|
||||
objects.
|
||||
- Ross Johnson
|
||||
|
||||
For security, the QuserEx.dll if used must now be installed in the Windows System
|
||||
folder.
|
||||
- Ross Johnson
|
||||
|
||||
New tests
|
||||
---------
|
||||
robust[1-5].c - Robust mutexes
|
||||
sequence1.c - per-thread unique sequence numbers
|
||||
|
||||
Modified tests and benchtests
|
||||
-----------------------------
|
||||
All mutex*.c tests wherever appropriate have been modified to also test
|
||||
robust mutexes under the same conditions.
|
||||
Added robust mutex benchtests to benchtest*.c wherever appropriate.
|
||||
|
||||
|
||||
RELEASE 2.8.0
|
||||
-------------
|
||||
(2006-12-22)
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* nmake file for uwin pthread library
|
||||
*/
|
||||
|
||||
VERSION = -
|
||||
CCFLAGS = -V -g $(CC.DLL)
|
||||
HAVE_PTW32_CONFIG_H == 1
|
||||
_MT == 1
|
||||
_timeb == timeb
|
||||
_ftime == ftime
|
||||
_errno == _ast_errno
|
||||
|
||||
$(INCLUDEDIR) :INSTALLDIR: pthread.h sched.h
|
||||
|
||||
pthread $(VERSION) :LIBRARY: attr.c barrier.c cancel.c cleanup.c condvar.c \
|
||||
create.c dll.c exit.c fork.c global.c misc.c mutex.c private.c \
|
||||
rwlock.c sched.c semaphore.c spin.c sync.c tsd.c nonportable.c
|
||||
|
||||
:: ANNOUNCE CONTRIBUTORS COPYING.LIB ChangeLog FAQ GNUmakefile MAINTAINERS \
|
||||
Makefile Makefile.in Makefile.vc NEWS PROGRESS README README.WinCE \
|
||||
TODO WinCE-PORT install-sh errno.c tests tests.mk acconfig.h \
|
||||
config.guess config.h.in config.sub configure configure.in signal.c \
|
||||
README.CV README.NONPORTABLE pthread.dsp pthread.dsw
|
||||
|
|
@ -0,0 +1,260 @@
|
|||
/* for running tests */
|
||||
CCFLAGS = -g
|
||||
_MT == 1
|
||||
_timeb == timeb
|
||||
_ftime == ftime
|
||||
|
||||
.SOURCE: tests
|
||||
/*
|
||||
:PACKAGE: pthread
|
||||
*/
|
||||
|
||||
set keepgoing
|
||||
|
||||
":test:" : .MAKE .OPERATOR
|
||||
local I
|
||||
$(<:D:B:S=.pass) : .IMPLICIT $(>:D:B:S=.pass)
|
||||
for I $(<) $(>)
|
||||
$(I:D:B:S=.pass) : .VIRTUAL .FORCE $(I)
|
||||
$(>)
|
||||
end
|
||||
sizes:: sizes.c
|
||||
loadfree:: loadfree.c
|
||||
mutex1:: mutex1.c
|
||||
mutex1e:: mutex1e.c
|
||||
mutex1n:: mutex1n.c
|
||||
mutex1r:: mutex1r.c
|
||||
mutex2:: mutex2.c
|
||||
mutex2r:: mutex2r.c
|
||||
mutex2e:: mutex2e.c
|
||||
exit1:: exit1.c
|
||||
condvar1:: condvar1.c
|
||||
condvar1_1:: condvar1_1.c
|
||||
condvar1_2:: condvar1_2.c
|
||||
self1:: self1.c
|
||||
condvar2:: condvar2.c
|
||||
condvar2_1:: condvar2_1.c
|
||||
condvar3_1:: condvar3_1.c
|
||||
condvar3_2:: condvar3_2.c
|
||||
condvar3_3:: condvar3_3.c
|
||||
create1.:: create1.c
|
||||
create2.:: create2.c
|
||||
cancel1:: cancel1.c
|
||||
cancel2:: cancel2.c
|
||||
mutex3:: mutex3.c
|
||||
mutex3r:: mutex3r.c
|
||||
mutex3e:: mutex3e.c
|
||||
mutex4:: mutex4.c
|
||||
mutex5:: mutex5.c
|
||||
mutex6:: mutex6.c
|
||||
mutex6e:: mutex6e.c
|
||||
mutex6n:: mutex6n.c
|
||||
mutex6r:: mutex6r.c
|
||||
mutex7:: mutex7.c
|
||||
mutex6s:: mutex6s.c
|
||||
mutex6rs:: mutex6rs.c
|
||||
mutex6es:: mutex6es.c
|
||||
mutex7e:: mutex7e.c
|
||||
mutex7n:: mutex7n.c
|
||||
mutex7r:: mutex7r.c
|
||||
mutex8:: mutex8.c
|
||||
mutex8e:: mutex8e.c
|
||||
mutex8n:: mutex8n.c
|
||||
mutex8r:: mutex8r.c
|
||||
equal1:: equal1.c
|
||||
exit2:: exit2.c
|
||||
exit3:: exit3.c
|
||||
exit4:: exit4.c
|
||||
exit5:: exit5.c
|
||||
join0:: join0.c
|
||||
join1:: join1.c
|
||||
join2:: join2.c
|
||||
join3:: join3.c
|
||||
kill1:: kill1.c
|
||||
count1:: count1.c
|
||||
once1:: once1.c
|
||||
tsd1:: tsd1.c
|
||||
self2:: self2.c
|
||||
eyal1:: eyal1.c
|
||||
condvar3:: condvar3.c
|
||||
condvar4:: condvar4.c
|
||||
condvar5:: condvar5.c
|
||||
condvar6:: condvar6.c
|
||||
condvar7:: condvar7.c
|
||||
condvar8:: condvar8.c
|
||||
condvar9:: condvar9.c
|
||||
errno1:: errno1.c
|
||||
reuse1.:: reuse1.c
|
||||
reuse2.:: reuse2.c
|
||||
rwlock1:: rwlock1.c
|
||||
rwlock2:: rwlock2.c
|
||||
rwlock3:: rwlock3.c
|
||||
rwlock4:: rwlock4.c
|
||||
rwlock5:: rwlock5.c
|
||||
rwlock6:: rwlock6.c
|
||||
rwlock7:: rwlock7.c
|
||||
rwlock8:: rwlock8.c
|
||||
rwlock2_t:: rwlock2_t.c
|
||||
rwlock3_t:: rwlock3_t.c
|
||||
rwlock4_t:: rwlock4_t.c
|
||||
rwlock5_t:: rwlock5_t.c
|
||||
rwlock6_t:: rwlock6_t.c
|
||||
rwlock6_t2:: rwlock6_t2.c
|
||||
semaphore1:: semaphore1.c
|
||||
semaphore2:: semaphore2.c
|
||||
semaphore3:: semaphore3.c
|
||||
context1:: context1.c
|
||||
cancel3:: cancel3.c
|
||||
cancel4:: cancel4.c
|
||||
cancel5:: cancel5.c
|
||||
cancel6a:: cancel6a.c
|
||||
cancel6d:: cancel6d.c
|
||||
cancel7:: cancel7.c
|
||||
cleanup0:: cleanup0.c
|
||||
cleanup1:: cleanup1.c
|
||||
cleanup2:: cleanup2.c
|
||||
cleanup3:: cleanup3.c
|
||||
priority1:: priority1.c
|
||||
priority2:: priority2.c
|
||||
inherit1:: inherit1.c
|
||||
spin1:: spin1.c
|
||||
spin2:: spin2.c
|
||||
spin3:: spin3.c
|
||||
spin4:: spin4.c
|
||||
barrier1:: barrier1.c
|
||||
barrier2:: barrier2.c
|
||||
barrier3:: barrier3.c
|
||||
barrier4:: barrier4.c
|
||||
barrier5:: barrier5.c
|
||||
exception1:: exception1.c
|
||||
exception2:: exception2.c
|
||||
exception3:: exception3.c
|
||||
benchtest1:: benchtest1.c
|
||||
benchtest2:: benchtest2.c
|
||||
benchtest3:: benchtest3.c
|
||||
benchtest4:: benchtest4.c
|
||||
benchtest5:: benchtest5.c
|
||||
valid1:: valid1.c
|
||||
valid2:: valid2.c
|
||||
cancel9:: cancel9.c
|
||||
|
||||
sizes: :test: sizes
|
||||
loadfree: :test:
|
||||
mutex5 :test: loadfree
|
||||
mutex1 :test: loadfree
|
||||
mutex1n :test: loadfree
|
||||
mutex1r :test: loadfree
|
||||
mutex1e :test: loadfree
|
||||
semaphore1 :test: loadfree
|
||||
semaphore2 :test: loadfree
|
||||
semaphore3 :test: loadfree
|
||||
mutex2 :test: loadfree
|
||||
mutex2r :test: loadfree
|
||||
mutex2e :test: loadfree
|
||||
exit1 :test: loadfree
|
||||
condvar1 :test: loadfree
|
||||
kill1 :test: loadfree
|
||||
condvar1_1 :test: condvar1
|
||||
condvar1_2 :test: join2
|
||||
self1 :test: loadfree
|
||||
condvar2 :test: condvar1
|
||||
condvar2_1 :test: condvar2
|
||||
create1 :test: mutex2
|
||||
create2 :test: create1
|
||||
reuse1 :test: create2
|
||||
reuse2 :test: reuse1
|
||||
cancel1 :test: create1
|
||||
cancel2 :test: cancel1
|
||||
mutex3 :test: create1
|
||||
mutex3r :test: create1
|
||||
mutex3e :test: create1
|
||||
mutex4 :test: mutex3
|
||||
mutex6 :test: mutex4
|
||||
mutex6n :test: mutex4
|
||||
mutex6e :test: mutex4
|
||||
mutex6r :test: mutex4
|
||||
mutex6s :test: mutex6
|
||||
mutex6rs :test: mutex6r
|
||||
mutex6es :test: mutex6e
|
||||
mutex7 :test: mutex6
|
||||
mutex7n :test: mutex6n
|
||||
mutex7e :test: mutex6e
|
||||
mutex7r :test: mutex6r
|
||||
mutex8 :test: mutex7
|
||||
mutex8n :test: mutex7n
|
||||
mutex8e :test: mutex7e
|
||||
mutex8r :test: mutex7r
|
||||
equal1 :test: create1
|
||||
exit2 :test: create1
|
||||
exit3 :test: create1
|
||||
exit4 :test: kill1
|
||||
exit5 :test: exit4
|
||||
join0 :test: create1
|
||||
join1 :test: create1
|
||||
join2 :test: create1
|
||||
join3 :test: join2
|
||||
count1 :test: join1
|
||||
once1 :test: create1
|
||||
tsd1 :test: join1
|
||||
self2 :test: create1
|
||||
eyal1 :test: tsd1
|
||||
condvar3 :test: create1
|
||||
condvar3_1 :test: condvar3
|
||||
condvar3_2 :test: condvar3_1
|
||||
condvar3_3 :test: condvar3_2
|
||||
condvar4 :test: create1
|
||||
condvar5 :test: condvar4
|
||||
condvar6 :test: condvar5
|
||||
condvar7 :test: condvar6 cleanup1
|
||||
condvar8 :test: condvar7
|
||||
condvar9 :test: condvar8
|
||||
errno1 :test: mutex3
|
||||
rwlock1 :test: condvar6
|
||||
rwlock2 :test: rwlock1
|
||||
rwlock3 :test: rwlock2
|
||||
rwlock4 :test: rwlock3
|
||||
rwlock5 :test: rwlock4
|
||||
rwlock6 :test: rwlock5
|
||||
rwlock7 :test: rwlock6
|
||||
rwlock8 :test: rwlock7
|
||||
rwlock2_t :test: rwlock2
|
||||
rwlock3_t :test: rwlock2_t
|
||||
rwlock4_t :test: rwlock3_t
|
||||
rwlock5_t :test: rwlock4_t
|
||||
rwlock6_t :test: rwlock5_t
|
||||
rwlock6_t2 :test: rwlock6_t
|
||||
context1 :test: cancel2
|
||||
cancel3 :test: context1
|
||||
cancel4 :test: cancel3
|
||||
cancel5 :test: cancel3
|
||||
cancel6a :test: cancel3
|
||||
cancel6d :test: cancel3
|
||||
cancel7 :test: kill1
|
||||
cleanup0 :test: cancel5
|
||||
cleanup1 :test: cleanup0
|
||||
cleanup2 :test: cleanup1
|
||||
cleanup3 :test: cleanup2
|
||||
priority1 :test: join1
|
||||
priority2 :test: priority1
|
||||
inherit1 :test: join1
|
||||
spin1 :test:
|
||||
spin2 :test: spin1.c
|
||||
spin3 :test: spin2.c
|
||||
spin4 :test: spin3.c
|
||||
barrier1 :test:
|
||||
barrier2 :test: barrier1.c
|
||||
barrier3 :test: barrier2.c
|
||||
barrier4 :test: barrier3.c
|
||||
barrier5 :test: barrier4.c
|
||||
benchtest1 :test: mutex3
|
||||
benchtest2 :test: benchtest1
|
||||
benchtest3 :test: benchtest2
|
||||
benchtest4 :test: benchtest3
|
||||
benchtest5 :test: benchtest4
|
||||
exception1 :test: cancel4
|
||||
exception2 :test: exception1
|
||||
exception3 :test: exception2
|
||||
exit4 :test: exit3
|
||||
valid1 :test: join1
|
||||
valid2 :test: valid1
|
||||
cancel9 :test: cancel8
|
|
@ -0,0 +1,4 @@
|
|||
Please see the ANNOUNCE file "Level of Standards Conformance"
|
||||
or the web page:
|
||||
|
||||
http://sources.redhat.com/pthreads-win32/conformance.html
|
|
@ -31,6 +31,10 @@ MSVC or GNU C (MinGW32 MSys development kit)
|
|||
To build from source.
|
||||
|
||||
QueueUserAPCEx by Panagiotis E. Hadjidoukas
|
||||
To support any thread cancelation in C++ library builds or
|
||||
to support cancelation of blocked threads in any build.
|
||||
This library is not required otherwise.
|
||||
|
||||
For true async cancelation of threads (including blocked threads).
|
||||
This is a DLL and Windows driver that provides pre-emptive APC
|
||||
by forcing threads into an alertable state when the APC is queued.
|
||||
|
@ -47,6 +51,10 @@ QueueUserAPCEx by Panagiotis E. Hadjidoukas
|
|||
are runnable. The simulated async cancellation cannot cancel blocked
|
||||
threads.
|
||||
|
||||
[FOR SECURITY] To be found Quserex.dll MUST be installed in the
|
||||
Windows System Folder. This is not an unreasonable constraint given a
|
||||
driver must also be installed and loaded at system startup.
|
||||
|
||||
|
||||
Library naming
|
||||
--------------
|
||||
|
@ -79,8 +87,8 @@ can differentiate between binary incompatible versions of the
|
|||
libs and dlls.
|
||||
|
||||
In general:
|
||||
pthread[VG]{SE,CE,C}c.dll
|
||||
pthread[VG]{SE,CE,C}c.lib
|
||||
pthread[VG]{SE,CE,C}[c].dll
|
||||
pthread[VG]{SE,CE,C}[c].lib
|
||||
|
||||
where:
|
||||
[VG] indicates the compiler
|
||||
|
@ -94,7 +102,7 @@ where:
|
|||
|
||||
c - DLL compatibility number indicating ABI and API
|
||||
compatibility with applications built against
|
||||
any snapshot with the same compatibility number.
|
||||
a snapshot with the same compatibility number.
|
||||
See 'Version numbering' below.
|
||||
|
||||
The name may also be suffixed by a 'd' to indicate a debugging version
|
||||
|
@ -102,7 +110,7 @@ of the library. E.g. pthreadVC2d.lib. Debugging versions contain
|
|||
additional information for debugging (symbols etc) and are often not
|
||||
optimised in any way (compiled with optimisation turned off).
|
||||
|
||||
For example:
|
||||
Examples:
|
||||
pthreadVSE.dll (MSVC/SEH)
|
||||
pthreadGCE.dll (GNUC/C++ EH)
|
||||
pthreadGC.dll (GNUC/not dependent on exceptions)
|
|
@ -0,0 +1,57 @@
|
|||
In ptw32_InterlockedCompareExchange.c, I've added a section for
|
||||
Borland's compiler; it's identical to that for the MS compiler except
|
||||
that it uses /* ... */ comments instead of ; comments.
|
||||
|
||||
[RPJ: need to define HAVE_TASM32 in config.h to use the above.]
|
||||
|
||||
|
||||
The other file is a makefile suitable for use with Borland's compiler
|
||||
(run "make -fBmakefile" in the directory). It builds a single version
|
||||
of the library, pthreadBC.dll and the corresponding pthreadBC.lib
|
||||
import library, which is comparable to the pthreadVC version; I can't
|
||||
personally see any demand for the versions that include structured or
|
||||
C++ exception cancellation handling so I haven't attempted to build
|
||||
those versions of the library. (I imagine a static version might be
|
||||
of use to some, but we can't legally use that on my commercial
|
||||
projects so I can't try that out, unfortunately.)
|
||||
|
||||
[RPJ: Added tests\Bmakefile as well.]
|
||||
|
||||
Borland C++ doesn't define the ENOSYS constant used by pthreads-win32;
|
||||
rather than make more extensive patches to the pthreads-win32 source I
|
||||
have a mostly-arbitrary constant for it in the makefile. However this
|
||||
doesn't make it visible to the application using the library, so if
|
||||
anyone actually wants to use this constant in their apps (why?)
|
||||
someone might like to make a seperate NEED_BCC_something define to add
|
||||
this stuff.
|
||||
|
||||
The makefile also #defines EDEADLK as EDEADLOCK, _timeb as timeb, and
|
||||
_ftime as ftime, to deal with the minor differences between the two
|
||||
RTLs' naming conventions, and sets the compiler flags as required to
|
||||
get a normal compile of the library.
|
||||
|
||||
[RPJ: Moved errno values and _timeb etc to pthread.h, so apps will also
|
||||
use them.]
|
||||
|
||||
(While I'm on the subject, the reason Borland users should recompile
|
||||
the library, rather than using the impdef/implib technique suggested
|
||||
previously on the mailing list, is that a) the errno constants are
|
||||
different, so the results returned by the pthread_* functions can be
|
||||
meaningless, and b) the errno variable/pseudo-variable itself is
|
||||
different in the MS & BCC runtimes, so you can't access the
|
||||
pthreadVC's errno from a Borland C++-compiled host application
|
||||
correctly - I imagine there are other potential problems from the RTL
|
||||
mismatch too.)
|
||||
|
||||
[RPJ: Make sure you use the same RTL in both dll and application builds.
|
||||
The dll and tests Bmakefiles use cw32mti.lib. Having some trouble with
|
||||
memory read exceptions running the test suite using BCC55.]
|
||||
|
||||
Best regards,
|
||||
Will
|
||||
|
||||
--
|
||||
Will Bryant
|
||||
Systems Architect, eCOSM Limited
|
||||
Cell +64 21 655 443, office +64 3 365 4176
|
||||
http://www.ecosm.com/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,783 @@
|
|||
This file documents non-portable functions and other issues.
|
||||
|
||||
Non-portable functions included in pthreads-win32
|
||||
-------------------------------------------------
|
||||
|
||||
BOOL
|
||||
pthread_win32_test_features_np(int mask)
|
||||
|
||||
This routine allows an application to check which
|
||||
run-time auto-detected features are available within
|
||||
the library.
|
||||
|
||||
The possible features are:
|
||||
|
||||
PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE
|
||||
Return TRUE if the native version of
|
||||
InterlockedCompareExchange() is being used.
|
||||
This feature is not meaningful in recent
|
||||
library versions as MSVC builds only support
|
||||
system implemented ICE. Note that all Mingw
|
||||
builds use inlined asm versions of all the
|
||||
Interlocked routines.
|
||||
PTW32_ALERTABLE_ASYNC_CANCEL
|
||||
Return TRUE is the QueueUserAPCEx package
|
||||
QUSEREX.DLL is available and the AlertDrv.sys
|
||||
driver is loaded into Windows, providing
|
||||
alertable (pre-emptive) asyncronous threads
|
||||
cancelation. If this feature returns FALSE
|
||||
then the default async cancel scheme is in
|
||||
use, which cannot cancel blocked threads.
|
||||
|
||||
Features may be Or'ed into the mask parameter, in which case
|
||||
the routine returns TRUE if any of the Or'ed features would
|
||||
return TRUE. At this stage it doesn't make sense to Or features
|
||||
but it may some day.
|
||||
|
||||
|
||||
void *
|
||||
pthread_timechange_handler_np(void *)
|
||||
|
||||
To improve tolerance against operator or time service
|
||||
initiated system clock changes.
|
||||
|
||||
This routine can be called by an application when it
|
||||
receives a WM_TIMECHANGE message from the system. At
|
||||
present it broadcasts all condition variables so that
|
||||
waiting threads can wake up and re-evaluate their
|
||||
conditions and restart their timed waits if required.
|
||||
|
||||
It has the same return type and argument type as a
|
||||
thread routine so that it may be called directly
|
||||
through pthread_create(), i.e. as a separate thread.
|
||||
|
||||
Parameters
|
||||
|
||||
Although a parameter must be supplied, it is ignored.
|
||||
The value NULL can be used.
|
||||
|
||||
Return values
|
||||
|
||||
It can return an error EAGAIN to indicate that not
|
||||
all condition variables were broadcast for some reason.
|
||||
Otherwise, 0 is returned.
|
||||
|
||||
If run as a thread, the return value is returned
|
||||
through pthread_join().
|
||||
|
||||
The return value should be cast to an integer.
|
||||
|
||||
|
||||
HANDLE
|
||||
pthread_getw32threadhandle_np(pthread_t thread);
|
||||
|
||||
Returns the win32 thread handle that the POSIX
|
||||
thread "thread" is running as.
|
||||
|
||||
Applications can use the win32 handle to set
|
||||
win32 specific attributes of the thread.
|
||||
|
||||
DWORD
|
||||
pthread_getw32threadid_np (pthread_t thread)
|
||||
|
||||
Returns the Windows native thread ID that the POSIX
|
||||
thread "thread" is running as.
|
||||
|
||||
Only valid when the library is built where
|
||||
! (defined(__MINGW64__) || defined(__MINGW32__)) || defined (__MSVCRT__) || defined (__DMC__)
|
||||
and otherwise returns 0.
|
||||
|
||||
|
||||
int
|
||||
pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr, int kind)
|
||||
|
||||
int
|
||||
pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr, int *kind)
|
||||
|
||||
These two routines are included for Linux compatibility
|
||||
and are direct equivalents to the standard routines
|
||||
pthread_mutexattr_settype
|
||||
pthread_mutexattr_gettype
|
||||
|
||||
pthread_mutexattr_setkind_np accepts the following
|
||||
mutex kinds:
|
||||
PTHREAD_MUTEX_FAST_NP
|
||||
PTHREAD_MUTEX_ERRORCHECK_NP
|
||||
PTHREAD_MUTEX_RECURSIVE_NP
|
||||
|
||||
These are really just equivalent to (respectively):
|
||||
PTHREAD_MUTEX_NORMAL
|
||||
PTHREAD_MUTEX_ERRORCHECK
|
||||
PTHREAD_MUTEX_RECURSIVE
|
||||
|
||||
int
|
||||
pthread_delay_np (const struct timespec *interval);
|
||||
|
||||
This routine causes a thread to delay execution for a specific period of time.
|
||||
This period ends at the current time plus the specified interval. The routine
|
||||
will not return before the end of the period is reached, but may return an
|
||||
arbitrary amount of time after the period has gone by. This can be due to
|
||||
system load, thread priorities, and system timer granularity.
|
||||
|
||||
Specifying an interval of zero (0) seconds and zero (0) nanoseconds is
|
||||
allowed and can be used to force the thread to give up the processor or to
|
||||
deliver a pending cancelation request.
|
||||
|
||||
This routine is a cancelation point.
|
||||
|
||||
The timespec structure contains the following two fields:
|
||||
|
||||
tv_sec is an integer number of seconds.
|
||||
tv_nsec is an integer number of nanoseconds.
|
||||
|
||||
Return Values
|
||||
|
||||
If an error condition occurs, this routine returns an integer value
|
||||
indicating the type of error. Possible return values are as follows:
|
||||
|
||||
0 Successful completion.
|
||||
[EINVAL] The value specified by interval is invalid.
|
||||
|
||||
int
|
||||
pthread_num_processors_np (void)
|
||||
|
||||
This routine (found on HPUX systems) returns the number of processors
|
||||
in the system. This implementation actually returns the number of
|
||||
processors available to the process, which can be a lower number
|
||||
than the system's number, depending on the process's affinity mask.
|
||||
|
||||
BOOL
|
||||
pthread_win32_process_attach_np (void);
|
||||
|
||||
BOOL
|
||||
pthread_win32_process_detach_np (void);
|
||||
|
||||
BOOL
|
||||
pthread_win32_thread_attach_np (void);
|
||||
|
||||
BOOL
|
||||
pthread_win32_thread_detach_np (void);
|
||||
|
||||
These functions contain the code normally run via dllMain
|
||||
when the library is used as a dll but which need to be
|
||||
called explicitly by an application when the library
|
||||
is statically linked. As of version 2.9.0 of the library, static
|
||||
builds using either MSC or GCC will call pthread_win32_process_*
|
||||
automatically at application startup and exit respectively.
|
||||
|
||||
Otherwise, you will need to call pthread_win32_process_attach_np()
|
||||
before you can call any pthread routines when statically linking.
|
||||
You should call pthread_win32_process_detach_np() before
|
||||
exiting your application to clean up.
|
||||
|
||||
pthread_win32_thread_attach_np() is currently a no-op, but
|
||||
pthread_win32_thread_detach_np() is needed to clean up
|
||||
the implicit pthread handle that is allocated to a Win32 thread if
|
||||
it calls any pthreads routines. Call this routine when the
|
||||
Win32 thread exits.
|
||||
|
||||
Threads created through pthread_create() do not need to call
|
||||
pthread_win32_thread_detach_np().
|
||||
|
||||
These functions invariably return TRUE except for
|
||||
pthread_win32_process_attach_np() which will return FALSE
|
||||
if pthreads-win32 initialisation fails.
|
||||
|
||||
int
|
||||
pthreadCancelableWait (HANDLE waitHandle);
|
||||
|
||||
int
|
||||
pthreadCancelableTimedWait (HANDLE waitHandle, DWORD timeout);
|
||||
|
||||
These two functions provide hooks into the pthread_cancel
|
||||
mechanism that will allow you to wait on a Windows handle
|
||||
and make it a cancellation point. Both functions block
|
||||
until either the given w32 handle is signaled, or
|
||||
pthread_cancel has been called. It is implemented using
|
||||
WaitForMultipleObjects on 'waitHandle' and a manually
|
||||
reset w32 event used to implement pthread_cancel.
|
||||
|
||||
|
||||
Non-portable issues
|
||||
-------------------
|
||||
|
||||
Thread priority
|
||||
|
||||
POSIX defines a single contiguous range of numbers that determine a
|
||||
thread's priority. Win32 defines priority classes and priority
|
||||
levels relative to these classes. Classes are simply priority base
|
||||
levels that the defined priority levels are relative to such that,
|
||||
changing a process's priority class will change the priority of all
|
||||
of it's threads, while the threads retain the same relativity to each
|
||||
other.
|
||||
|
||||
A Win32 system defines a single contiguous monotonic range of values
|
||||
that define system priority levels, just like POSIX. However, Win32
|
||||
restricts individual threads to a subset of this range on a
|
||||
per-process basis.
|
||||
|
||||
The following table shows the base priority levels for combinations
|
||||
of priority class and priority value in Win32.
|
||||
|
||||
Process Priority Class Thread Priority Level
|
||||
-----------------------------------------------------------------
|
||||
1 IDLE_PRIORITY_CLASS THREAD_PRIORITY_IDLE
|
||||
1 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE
|
||||
1 NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE
|
||||
1 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_IDLE
|
||||
1 HIGH_PRIORITY_CLASS THREAD_PRIORITY_IDLE
|
||||
2 IDLE_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
3 IDLE_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
4 IDLE_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
4 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
5 IDLE_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
5 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
5 Background NORMAL_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
6 IDLE_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
6 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
6 Background NORMAL_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
7 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
7 Background NORMAL_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
7 Foreground NORMAL_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
8 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
8 NORMAL_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
8 Foreground NORMAL_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
8 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
9 NORMAL_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
9 Foreground NORMAL_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
9 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
10 Foreground NORMAL_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
10 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
11 Foreground NORMAL_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
11 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
11 HIGH_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
12 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
12 HIGH_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
13 HIGH_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
14 HIGH_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
15 HIGH_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
15 HIGH_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
|
||||
15 IDLE_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
|
||||
15 BELOW_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
|
||||
15 NORMAL_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
|
||||
15 ABOVE_NORMAL_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
|
||||
16 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_IDLE
|
||||
17 REALTIME_PRIORITY_CLASS -7
|
||||
18 REALTIME_PRIORITY_CLASS -6
|
||||
19 REALTIME_PRIORITY_CLASS -5
|
||||
20 REALTIME_PRIORITY_CLASS -4
|
||||
21 REALTIME_PRIORITY_CLASS -3
|
||||
22 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_LOWEST
|
||||
23 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_BELOW_NORMAL
|
||||
24 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_NORMAL
|
||||
25 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_ABOVE_NORMAL
|
||||
26 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_HIGHEST
|
||||
27 REALTIME_PRIORITY_CLASS 3
|
||||
28 REALTIME_PRIORITY_CLASS 4
|
||||
29 REALTIME_PRIORITY_CLASS 5
|
||||
30 REALTIME_PRIORITY_CLASS 6
|
||||
31 REALTIME_PRIORITY_CLASS THREAD_PRIORITY_TIME_CRITICAL
|
||||
|
||||
Windows NT: Values -7, -6, -5, -4, -3, 3, 4, 5, and 6 are not supported.
|
||||
|
||||
|
||||
As you can see, the real priority levels available to any individual
|
||||
Win32 thread are non-contiguous.
|
||||
|
||||
An application using pthreads-win32 should not make assumptions about
|
||||
the numbers used to represent thread priority levels, except that they
|
||||
are monotonic between the values returned by sched_get_priority_min()
|
||||
and sched_get_priority_max(). E.g. Windows 95, 98, NT, 2000, XP make
|
||||
available a non-contiguous range of numbers between -15 and 15, while
|
||||
at least one version of WinCE (3.0) defines the minimum priority
|
||||
(THREAD_PRIORITY_LOWEST) as 5, and the maximum priority
|
||||
(THREAD_PRIORITY_HIGHEST) as 1.
|
||||
|
||||
Internally, pthreads-win32 maps any priority levels between
|
||||
THREAD_PRIORITY_IDLE and THREAD_PRIORITY_LOWEST to THREAD_PRIORITY_LOWEST,
|
||||
or between THREAD_PRIORITY_TIME_CRITICAL and THREAD_PRIORITY_HIGHEST to
|
||||
THREAD_PRIORITY_HIGHEST. Currently, this also applies to
|
||||
REALTIME_PRIORITY_CLASSi even if levels -7, -6, -5, -4, -3, 3, 4, 5, and 6
|
||||
are supported.
|
||||
|
||||
If it wishes, a Win32 application using pthreads-win32 can use the Win32
|
||||
defined priority macros THREAD_PRIORITY_IDLE through
|
||||
THREAD_PRIORITY_TIME_CRITICAL.
|
||||
|
||||
|
||||
The opacity of the pthread_t datatype
|
||||
-------------------------------------
|
||||
and possible solutions for portable null/compare/hash, etc
|
||||
----------------------------------------------------------
|
||||
|
||||
Because pthread_t is an opague datatype an implementation is permitted to define
|
||||
pthread_t in any way it wishes. That includes defining some bits, if it is
|
||||
scalar, or members, if it is an aggregate, to store information that may be
|
||||
extra to the unique identifying value of the ID. As a result, pthread_t values
|
||||
may not be directly comparable.
|
||||
|
||||
If you want your code to be portable you must adhere to the following contraints:
|
||||
|
||||
1) Don't assume it is a scalar data type, e.g. an integer or pointer value. There
|
||||
are several other implementations where pthread_t is also a struct. See our FAQ
|
||||
Question 11 for our reasons for defining pthread_t as a struct.
|
||||
|
||||
2) You must not compare them using relational or equality operators. You must use
|
||||
the API function pthread_equal() to test for equality.
|
||||
|
||||
3) Never attempt to reference individual members.
|
||||
|
||||
|
||||
The problem
|
||||
|
||||
Certain applications would like to be able to access only the 'pure' pthread_t
|
||||
id values, primarily to use as keys into data structures to manage threads or
|
||||
thread-related data, but this is not possible in a maximally portable and
|
||||
standards compliant way for current POSIX threads implementations.
|
||||
|
||||
For implementations that define pthread_t as a scalar, programmers often employ
|
||||
direct relational and equality operators on pthread_t. This code will break when
|
||||
ported to an implementation that defines pthread_t as an aggregate type.
|
||||
|
||||
For implementations that define pthread_t as an aggregate, e.g. a struct,
|
||||
programmers can use memcmp etc., but then face the prospect that the struct may
|
||||
include alignment padding bytes or bits as well as extra implementation-specific
|
||||
members that are not part of the unique identifying value.
|
||||
|
||||
[While this is not currently the case for pthreads-win32, opacity also
|
||||
means that an implementation is free to change the definition, which should
|
||||
generally only require that applications be recompiled and relinked, not
|
||||
rewritten.]
|
||||
|
||||
|
||||
Doesn't the compiler take care of padding?
|
||||
|
||||
The C89 and later standards only effectively guarrantee element-by-element
|
||||
equivalence following an assignment or pass by value of a struct or union,
|
||||
therefore undefined areas of any two otherwise equivalent pthread_t instances
|
||||
can still compare differently, e.g. attempting to compare two such pthread_t
|
||||
variables byte-by-byte, e.g. memcmp(&t1, &t2, sizeof(pthread_t) may give an
|
||||
incorrect result. In practice I'm reasonably confident that compilers routinely
|
||||
also copy the padding bytes, mainly because assignment of unions would be far
|
||||
too complicated otherwise. But it just isn't guarranteed by the standard.
|
||||
|
||||
Illustration:
|
||||
|
||||
We have two thread IDs t1 and t2
|
||||
|
||||
pthread_t t1, t2;
|
||||
|
||||
In an application we create the threads and intend to store the thread IDs in an
|
||||
ordered data structure (linked list, tree, etc) so we need to be able to compare
|
||||
them in order to insert them initially and also to traverse.
|
||||
|
||||
Suppose pthread_t contains undefined padding bits and our compiler copies our
|
||||
pthread_t [struct] element-by-element, then for the assignment:
|
||||
|
||||
pthread_t temp = t1;
|
||||
|
||||
temp and t1 will be equivalent and correct but a byte-for-byte comparison such as
|
||||
memcmp(&temp, &t1, sizeof(pthread_t)) == 0 may not return true as we expect because
|
||||
the undefined bits may not have the same values in the two variable instances.
|
||||
|
||||
Similarly if passing by value under the same conditions.
|
||||
|
||||
If, on the other hand, the undefined bits are at least constant through every
|
||||
assignment and pass-by-value then the byte-for-byte comparison
|
||||
memcmp(&temp, &t1, sizeof(pthread_t)) == 0 will always return the expected result.
|
||||
How can we force the behaviour we need?
|
||||
|
||||
|
||||
Solutions
|
||||
|
||||
Adding new functions to the standard API or as non-portable extentions is
|
||||
the only reliable and portable way to provide the necessary operations.
|
||||
Remember also that POSIX is not tied to the C language. The most common
|
||||
functions that have been suggested are:
|
||||
|
||||
pthread_null()
|
||||
pthread_compare()
|
||||
pthread_hash()
|
||||
|
||||
A single more general purpose function could also be defined as a
|
||||
basis for at least the last two of the above functions.
|
||||
|
||||
First we need to list the freedoms and constraints with restpect
|
||||
to pthread_t so that we can be sure our solution is compatible with the
|
||||
standard.
|
||||
|
||||
What is known or may be deduced from the standard:
|
||||
1) pthread_t must be able to be passed by value, so it must be a single object.
|
||||
2) from (1) it must be copyable so cannot embed thread-state information, locks
|
||||
or other volatile objects required to manage the thread it associates with.
|
||||
3) pthread_t may carry additional information, e.g. for debugging or to manage
|
||||
itself.
|
||||
4) there is an implicit requirement that the size of pthread_t is determinable
|
||||
at compile-time and size-invariant, because it must be able to copy the object
|
||||
(i.e. through assignment and pass-by-value). Such copies must be genuine
|
||||
duplicates, not merely a copy of a pointer to a common instance such as
|
||||
would be the case if pthread_t were defined as an array.
|
||||
|
||||
|
||||
Suppose we define the following function:
|
||||
|
||||
/* This function shall return it's argument */
|
||||
pthread_t* pthread_normalize(pthread_t* thread);
|
||||
|
||||
For scalar or aggregate pthread_t types this function would simply zero any bits
|
||||
within the pthread_t that don't uniquely identify the thread, including padding,
|
||||
such that client code can return consistent results from operations done on the
|
||||
result. If the additional bits are a pointer to an associate structure then
|
||||
this function would ensure that the memory used to store that associate
|
||||
structure does not leak. After normalization the following compare would be
|
||||
valid and repeatable:
|
||||
|
||||
memcmp(pthread_normalize(&t1),pthread_normalize(&t2),sizeof(pthread_t))
|
||||
|
||||
Note 1: such comparisons are intended merely to order and sort pthread_t values
|
||||
and allow them to index various data structures. They are not intended to reveal
|
||||
anything about the relationships between threads, like startup order.
|
||||
|
||||
Note 2: the normalized pthread_t is also a valid pthread_t that uniquely
|
||||
identifies the same thread.
|
||||
|
||||
Advantages:
|
||||
1) In most existing implementations this function would reduce to a no-op that
|
||||
emits no additional instructions, i.e after in-lining or optimisation, or if
|
||||
defined as a macro:
|
||||
#define pthread_normalise(tptr) (tptr)
|
||||
|
||||
2) This single function allows an application to portably derive
|
||||
application-level versions of any of the other required functions.
|
||||
|
||||
3) It is a generic function that could enable unanticipated uses.
|
||||
|
||||
Disadvantages:
|
||||
1) Less efficient than dedicated compare or hash functions for implementations
|
||||
that include significant extra non-id elements in pthread_t.
|
||||
|
||||
2) Still need to be concerned about padding if copying normalized pthread_t.
|
||||
See the later section on defining pthread_t to neutralise padding issues.
|
||||
|
||||
Generally a pthread_t may need to be normalized every time it is used,
|
||||
which could have a significant impact. However, this is a design decision
|
||||
for the implementor in a competitive environment. An implementation is free
|
||||
to define a pthread_t in a way that minimises or eliminates padding or
|
||||
renders this function a no-op.
|
||||
|
||||
Hazards:
|
||||
1) Pass-by-reference directly modifies 'thread' so the application must
|
||||
synchronise access or ensure that the pointer refers to a copy. The alternative
|
||||
of pass-by-value/return-by-value was considered but then this requires two copy
|
||||
operations, disadvantaging implementations where this function is not a no-op
|
||||
in terms of speed of execution. This function is intended to be used in high
|
||||
frequency situations and needs to be efficient, or at least not unnecessarily
|
||||
inefficient. The alternative also sits awkwardly with functions like memcmp.
|
||||
|
||||
2) [Non-compliant] code that uses relational and equality operators on
|
||||
arithmetic or pointer style pthread_t types would need to be rewritten, but it
|
||||
should be rewritten anyway.
|
||||
|
||||
|
||||
C implementation of null/compare/hash functions using pthread_normalize():
|
||||
|
||||
/* In pthread.h */
|
||||
pthread_t* pthread_normalize(pthread_t* thread);
|
||||
|
||||
/* In user code */
|
||||
/* User-level bitclear function - clear bits in loc corresponding to mask */
|
||||
void* bitclear (void* loc, void* mask, size_t count);
|
||||
|
||||
typedef unsigned int hash_t;
|
||||
|
||||
/* User-level hash function */
|
||||
hash_t hash(void* ptr, size_t count);
|
||||
|
||||
/*
|
||||
* User-level pthr_null function - modifies the origin thread handle.
|
||||
* The concept of a null pthread_t is highly implementation dependent
|
||||
* and this design may be far from the mark. For example, in an
|
||||
* implementation "null" may mean setting a special value inside one
|
||||
* element of pthread_t to mean "INVALID". However, if that value was zero and
|
||||
* formed part of the id component then we may get away with this design.
|
||||
*/
|
||||
pthread_t* pthr_null(pthread_t* tp)
|
||||
{
|
||||
/*
|
||||
* This should have the same effect as memset(tp, 0, sizeof(pthread_t))
|
||||
* We're just showing that we can do it.
|
||||
*/
|
||||
void* p = (void*) pthread_normalize(tp);
|
||||
return (pthread_t*) bitclear(p, p, sizeof(pthread_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* Safe user-level pthr_compare function - modifies temporary thread handle copies
|
||||
*/
|
||||
int pthr_compare_safe(pthread_t thread1, pthread_t thread2)
|
||||
{
|
||||
return memcmp(pthread_normalize(&thread1), pthread_normalize(&thread2), sizeof(pthread_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* Fast user-level pthr_compare function - modifies origin thread handles
|
||||
*/
|
||||
int pthr_compare_fast(pthread_t* thread1, pthread_t* thread2)
|
||||
{
|
||||
return memcmp(pthread_normalize(&thread1), pthread_normalize(&thread2), sizeof(pthread_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* Safe user-level pthr_hash function - modifies temporary thread handle copy
|
||||
*/
|
||||
hash_t pthr_hash_safe(pthread_t thread)
|
||||
{
|
||||
return hash((void *) pthread_normalize(&thread), sizeof(pthread_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* Fast user-level pthr_hash function - modifies origin thread handle
|
||||
*/
|
||||
hash_t pthr_hash_fast(pthread_t thread)
|
||||
{
|
||||
return hash((void *) pthread_normalize(&thread), sizeof(pthread_t));
|
||||
}
|
||||
|
||||
/* User-level bitclear function - modifies the origin array */
|
||||
void* bitclear(void* loc, void* mask, size_t count)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < count; i++) {
|
||||
(unsigned char) *loc++ &= ~((unsigned char) *mask++);
|
||||
}
|
||||
}
|
||||
|
||||
/* Donald Knuth hash */
|
||||
hash_t hash(void* str, size_t count)
|
||||
{
|
||||
hash_t hash = (hash_t) count;
|
||||
unsigned int i = 0;
|
||||
|
||||
for(i = 0; i < len; str++, i++)
|
||||
{
|
||||
hash = ((hash << 5) ^ (hash >> 27)) ^ (*str);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Example of advantage point (3) - split a thread handle into its id and non-id values */
|
||||
pthread_t id = thread, non-id = thread;
|
||||
bitclear((void*) &non-id, (void*) pthread_normalize(&id), sizeof(pthread_t));
|
||||
|
||||
|
||||
A pthread_t type change proposal to neutralise the effects of padding
|
||||
|
||||
Even if pthread_nornalize() is available, padding is still a problem because
|
||||
the standard only garrantees element-by-element equivalence through
|
||||
copy operations (assignment and pass-by-value). So padding bit values can
|
||||
still change randomly after calls to pthread_normalize().
|
||||
|
||||
[I suspect that most compilers take the easy path and always byte-copy anyway,
|
||||
partly because it becomes too complex to do (e.g. unions that contain sub-aggregates)
|
||||
but also because programmers can easily design their aggregates to minimise and
|
||||
often eliminate padding].
|
||||
|
||||
How can we eliminate the problem of padding bytes in structs? Could
|
||||
defining pthread_t as a union rather than a struct provide a solution?
|
||||
|
||||
In fact, the Linux pthread.h defines most of it's pthread_*_t objects (but not
|
||||
pthread_t itself) as unions, possibly for this and/or other reasons. We'll
|
||||
borrow some element naming from there but the ideas themselves are well known
|
||||
- the __align element used to force alignment of the union comes from K&R's
|
||||
storage allocator example.
|
||||
|
||||
/* Essentially our current pthread_t renamed */
|
||||
typedef struct {
|
||||
struct thread_state_t * __p;
|
||||
long __x; /* sequence counter */
|
||||
} thread_id_t;
|
||||
|
||||
Ensuring that the last element in the above struct is a long ensures that the
|
||||
overall struct size is a multiple of sizeof(long), so there should be no trailing
|
||||
padding in this struct or the union we define below.
|
||||
(Later we'll see that we can handle internal but not trailing padding.)
|
||||
|
||||
/* New pthread_t */
|
||||
typedef union {
|
||||
char __size[sizeof(thread_id_t)]; /* array as the first element */
|
||||
thread_id_t __tid;
|
||||
long __align; /* Ensure that the union starts on long boundary */
|
||||
} pthread_t;
|
||||
|
||||
This guarrantees that, during an assignment or pass-by-value, the compiler copies
|
||||
every byte in our thread_id_t because the compiler guarrantees that the __size
|
||||
array, which we have ensured is the equal-largest element in the union, retains
|
||||
equivalence.
|
||||
|
||||
This means that pthread_t values stored, assigned and passed by value will at least
|
||||
carry the value of any undefined padding bytes along and therefore ensure that
|
||||
those values remain consistent. Our comparisons will return consistent results and
|
||||
our hashes of [zero initialised] pthread_t values will also return consistent
|
||||
results.
|
||||
|
||||
We have also removed the need for a pthread_null() function; we can initialise
|
||||
at declaration time or easily create our own const pthread_t to use in assignments
|
||||
later:
|
||||
|
||||
const pthread_t null_tid = {0}; /* braces are required */
|
||||
|
||||
pthread_t t;
|
||||
...
|
||||
t = null_tid;
|
||||
|
||||
|
||||
Note that we don't have to explicitly make use of the __size array at all. It's
|
||||
there just to force the compiler behaviour we want.
|
||||
|
||||
|
||||
Partial solutions without a pthread_normalize function
|
||||
|
||||
|
||||
An application-level pthread_null and pthread_compare proposal
|
||||
(and pthread_hash proposal by extention)
|
||||
|
||||
In order to deal with the problem of scalar/aggregate pthread_t type disparity in
|
||||
portable code I suggest using an old-fashioned union, e.g.:
|
||||
|
||||
Contraints:
|
||||
- there is no padding, or padding values are preserved through assignment and
|
||||
pass-by-value (see above);
|
||||
- there are no extra non-id values in the pthread_t.
|
||||
|
||||
|
||||
Example 1: A null initialiser for pthread_t variables...
|
||||
|
||||
typedef union {
|
||||
unsigned char b[sizeof(pthread_t)];
|
||||
pthread_t t;
|
||||
} init_t;
|
||||
|
||||
const init_t initial = {0};
|
||||
|
||||
pthread_t tid = initial.t; /* init tid to all zeroes */
|
||||
|
||||
|
||||
Example 2: A comparison function for pthread_t values
|
||||
|
||||
typedef union {
|
||||
unsigned char b[sizeof(pthread_t)];
|
||||
pthread_t t;
|
||||
} pthcmp_t;
|
||||
|
||||
int pthcmp(pthread_t left, pthread_t right)
|
||||
{
|
||||
/*
|
||||
* Compare two pthread handles in a way that imposes a repeatable but arbitrary
|
||||
* ordering on them.
|
||||
* I.e. given the same set of pthread_t handles the ordering should be the same
|
||||
* each time but the order has no particular meaning other than that. E.g.
|
||||
* the ordering does not imply the thread start sequence, or any other
|
||||
* relationship between threads.
|
||||
*
|
||||
* Return values are:
|
||||
* 1 : left is greater than right
|
||||
* 0 : left is equal to right
|
||||
* -1 : left is less than right
|
||||
*/
|
||||
int i;
|
||||
pthcmp_t L, R;
|
||||
L.t = left;
|
||||
R.t = right;
|
||||
for (i = 0; i < sizeof(pthread_t); i++)
|
||||
{
|
||||
if (L.b[i] > R.b[i])
|
||||
return 1;
|
||||
else if (L.b[i] < R.b[i])
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
It has been pointed out that the C99 standard allows for the possibility that
|
||||
integer types also may include padding bits, which could invalidate the above
|
||||
method. This addition to C99 was specifically included after it was pointed
|
||||
out that there was one, presumably not particularly well known, architecture
|
||||
that included a padding bit in it's 32 bit integer type. See section 6.2.6.2
|
||||
of both the standard and the rationale, specifically the paragraph starting at
|
||||
line 16 on page 43 of the rationale.
|
||||
|
||||
|
||||
An aside
|
||||
|
||||
Certain compilers, e.g. gcc and one of the IBM compilers, include a feature
|
||||
extention: provided the union contains a member of the same type as the
|
||||
object then the object may be cast to the union itself.
|
||||
|
||||
We could use this feature to speed up the pthrcmp() function from example 2
|
||||
above by casting rather than assigning the pthread_t arguments to the union, e.g.:
|
||||
|
||||
int pthcmp(pthread_t left, pthread_t right)
|
||||
{
|
||||
/*
|
||||
* Compare two pthread handles in a way that imposes a repeatable but arbitrary
|
||||
* ordering on them.
|
||||
* I.e. given the same set of pthread_t handles the ordering should be the same
|
||||
* each time but the order has no particular meaning other than that. E.g.
|
||||
* the ordering does not imply the thread start sequence, or any other
|
||||
* relationship between threads.
|
||||
*
|
||||
* Return values are:
|
||||
* 1 : left is greater than right
|
||||
* 0 : left is equal to right
|
||||
* -1 : left is less than right
|
||||
*/
|
||||
int i;
|
||||
for (i = 0; i < sizeof(pthread_t); i++)
|
||||
{
|
||||
if (((pthcmp_t)left).b[i] > ((pthcmp_t)right).b[i])
|
||||
return 1;
|
||||
else if (((pthcmp_t)left).b[i] < ((pthcmp_t)right).b[i])
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Result thus far
|
||||
|
||||
We can't remove undefined bits if they are there in pthread_t already, but we have
|
||||
attempted to render them inert for comparison and hashing functions by making them
|
||||
consistent through assignment, copy and pass-by-value.
|
||||
|
||||
Note: Hashing pthread_t values requires that all pthread_t variables be initialised
|
||||
to the same value (usually all zeros) before being assigned a proper thread ID, i.e.
|
||||
to ensure that any padding bits are zero, or at least the same value for all
|
||||
pthread_t. Since all pthread_t values are generated by the library in the first
|
||||
instance this need not be an application-level operation.
|
||||
|
||||
|
||||
Conclusion
|
||||
|
||||
I've attempted to resolve the multiple issues of type opacity and the possible
|
||||
presence of undefined bits and bytes in pthread_t values, which prevent
|
||||
applications from comparing or hashing pthread handles.
|
||||
|
||||
Two complimentary partial solutions have been proposed, one an application-level
|
||||
scheme to handle both scalar and aggregate pthread_t types equally, plus a
|
||||
definition of pthread_t itself that neutralises padding bits and bytes by
|
||||
coercing semantics out of the compiler to eliminate variations in the values of
|
||||
padding bits.
|
||||
|
||||
I have not provided any solution to the problem of handling extra values embedded
|
||||
in pthread_t, e.g. debugging or trap information that an implementation is entitled
|
||||
to include. Therefore none of this replaces the portability and flexibility of API
|
||||
functions but what functions are needed? The threads standard is unlikely to
|
||||
include that can be implemented by a combination of existing features and more
|
||||
generic functions (several references in the threads rationale suggest this.
|
||||
Therefore I propose that the following function could replace the several functions
|
||||
that have been suggested in conversations:
|
||||
|
||||
pthread_t * pthread_normalize(pthread_t * handle);
|
||||
|
||||
For most existing pthreads implementations this function, or macro, would reduce to
|
||||
a no-op with zero call overhead.
|
|
@ -0,0 +1,62 @@
|
|||
Watcom compiler notes
|
||||
=====================
|
||||
|
||||
Status
|
||||
------
|
||||
Not yet usable. Although the library builds under Watcom it
|
||||
substantially fails the test suite.
|
||||
|
||||
There is a working Wmakefile for wmake for the library build.
|
||||
|
||||
invoke as any of:
|
||||
wmake -f Wmakefile clean WC
|
||||
wmake -f Wmakefile clean WC-inlined
|
||||
wmake -f Wmakefile clean WCE
|
||||
wmake -f Wmakefile clean WCE-inlined
|
||||
|
||||
These build pthreadWC.dll and pthreadWCE.dll.
|
||||
|
||||
There is a working Wmakefile for wmake for the test suite.
|
||||
|
||||
invoke as any of:
|
||||
wmake -f Wmakefile clean WC
|
||||
wmake -f Wmakefile clean WCX
|
||||
wmake -f Wmakefile clean WCE
|
||||
wmake -f Wmakefile clean WC-bench
|
||||
wmake -f Wmakefile clean WCX-bench
|
||||
wmake -f Wmakefile clean WCE-bench
|
||||
|
||||
|
||||
Current known problems
|
||||
----------------------
|
||||
|
||||
Library build:
|
||||
The Watcom compiler uses a different default call convention to MS C or GNU C and so
|
||||
applications are not compatible with pthreadVC.dll etc using pre 2003-10-14 versions
|
||||
of pthread.h, sched.h, or semaphore.h. The cdecl attribute can be used on exposed
|
||||
function prototypes to force compatibility with MS C built DLLs.
|
||||
|
||||
However, there appear to be other incompatibilities. Errno.h, for example, defines
|
||||
different values for the standard C and POSIX errors to those defined by the MS C
|
||||
errno.h. It may be that references to Watcom's threads compatible 'errno' do set
|
||||
and return translated numbers consistently, but I have not verified this.
|
||||
|
||||
Watcom defines errno as a dereferenced pointer returned by the function
|
||||
_get_errno_ptr(). This is similar to both the MS and GNU C environments for
|
||||
multithreaded use. However, the Watcom version appears to have a number of problems:
|
||||
|
||||
- different threads return the same pointer value. Compare with the MS and GNU C
|
||||
versions which correctly return different values (since each thread must maintain
|
||||
a thread specific errno value).
|
||||
|
||||
- an errno value set within the DLL appears as zero in the application even though
|
||||
both share the same thread.
|
||||
|
||||
Therefore applications built using the Watcom compiler may need to use
|
||||
a Watcom built version of the library (pthreadWC.dll). If this is the case, then
|
||||
the cdecl function attribute should not be required.
|
||||
|
||||
Application builds:
|
||||
The test suite fails with the Watcom compiler.
|
||||
|
||||
Test semaphore1.c fails for pthreadWC.dll because errno returns 0 instead of EAGAIN.
|
|
@ -0,0 +1,6 @@
|
|||
WinCE port
|
||||
----------
|
||||
(See the file WinCE-PORT for a detailed explanation.)
|
||||
|
||||
Make sure you define "WINCE" amongst your compiler flags (eg. -DWINCE).
|
||||
The config.h file will define all the necessary defines for you.
|
|
@ -0,0 +1,222 @@
|
|||
NOTE: The comments in this file relate to the original WinCE port
|
||||
done by Tristan Savatier. The semaphore routines have been
|
||||
completely rewritten since (2005-04-25), having been progressively
|
||||
broken more and more by changes to the library. All of the semaphore
|
||||
routines implemented for W9x/WNT/2000 and up should now also work for
|
||||
WinCE. Also, pthread_mutex_timedlock should now work.
|
||||
|
||||
Additional WinCE updates have been applied since this as well. Check the
|
||||
ChangeLog file and search for WINCE for example. (2007-01-07)
|
||||
|
||||
[RPJ]
|
||||
|
||||
----
|
||||
|
||||
Some interesting news:
|
||||
|
||||
I have been able to port pthread-win32 to Windows-CE,
|
||||
which uses a subset of the WIN32 API.
|
||||
|
||||
Since we intend to keep using pthread-win32 for our
|
||||
Commercial WinCE developments, I would be very interested
|
||||
if WinCE support could be added to the main source tree
|
||||
of pthread-win32. Also, I would like to be credited
|
||||
for this port :-)
|
||||
|
||||
Now, here is the story...
|
||||
|
||||
The port was performed and tested on a Casio "Cassiopeia"
|
||||
PalmSize PC, which runs a MIP processor. The OS in the
|
||||
Casio is WinCE version 2.11, but I used VC++ 6.0 with
|
||||
the WinCE SDK for version 2.01.
|
||||
|
||||
I used pthread-win32 to port a heavily multithreaded
|
||||
commercial application (real-time MPEG video player)
|
||||
from Linux to WinCE. I consider the changes that
|
||||
I have done to be quite well tested.
|
||||
|
||||
Overall the modifications that we had to do are minor.
|
||||
|
||||
The WinCE port were based on pthread-win32-snap-1999-05-30,
|
||||
but I am certain that they can be integrated very easiely
|
||||
to more recent versions of the source.
|
||||
|
||||
I have attached the modified source code:
|
||||
pthread-win32-snap-1999-05-30-WinCE.
|
||||
|
||||
All the changes do not affect the code compiled on non-WinCE
|
||||
environment, provided that the macros used for WinCE compilation
|
||||
are not used, of course!
|
||||
|
||||
Overall description of the WinCE port:
|
||||
-------------------------------------
|
||||
|
||||
Most of the changes had to be made in areas where
|
||||
pthread-win32 was relying on some standard-C librairies
|
||||
(e.g. _ftime, calloc, errno), which are not available
|
||||
on WinCE. We have changed the code to use native Win32
|
||||
API instead (or in some cases we made wrappers).
|
||||
|
||||
The Win32 Semaphores are not available,
|
||||
so we had to re-implement Semaphores using mutexes
|
||||
and events.
|
||||
|
||||
Limitations / known problems of the WinCE port:
|
||||
----------------------------------------------
|
||||
|
||||
Not all the semaphore routines have been ported
|
||||
(semaphores are defined by Posix but are not part
|
||||
pf pthread). I have just done enough to make
|
||||
pthread routines (that rely internally on semaphores)
|
||||
work, like signal conditions.
|
||||
|
||||
I noticed that the Win32 threads work slightly
|
||||
differently on WinCE. This may have some impact
|
||||
on some tricky parts of pthread-win32, but I have
|
||||
not really investigated. For example, on WinCE,
|
||||
the process is killed if the main thread falls off
|
||||
the bottom (or calls pthread_exit), regardless
|
||||
of the existence of any other detached thread.
|
||||
Microsoft manual indicates that this behavior is
|
||||
deffirent from that of Windows Threads for other
|
||||
Win32 platforms.
|
||||
|
||||
|
||||
Detailed descriptions of the changes and rationals:
|
||||
|
||||
------------------------------------
|
||||
- use a new macro NEED_ERRNO.
|
||||
|
||||
If defined, the code in errno.c that defines a reentrant errno
|
||||
is compiled, regardless of _MT and _REENTRANT.
|
||||
|
||||
Rational: On WinCE, there is no support for <stdio.h>, <errno.h> or
|
||||
any other standard C library, i.e. even if _MT or _REENTRANT
|
||||
is defined, errno is not provided by any library. NEED_ERRNO
|
||||
must be set to compile for WinCE.
|
||||
|
||||
------------------------------------
|
||||
- In implement.h, change #include <semaphore.h> to #include "semaphore.h".
|
||||
|
||||
Rational: semaphore.h is provided in pthread-win32 and should not
|
||||
be searched in the systems standard include. would not compile.
|
||||
This change does not seem to create problems on "classic" win32
|
||||
(e.g. win95).
|
||||
|
||||
------------------------------------
|
||||
- use a new macro NEED_CALLOC.
|
||||
|
||||
If defined, some code in misc.c will provide a replacement
|
||||
for calloc, which is not available on Win32.
|
||||
|
||||
|
||||
------------------------------------
|
||||
- use a new macro NEED_CREATETHREAD.
|
||||
|
||||
If defined, implement.h defines the macro _beginthreadex
|
||||
and _endthreadex.
|
||||
|
||||
Rational: On WinCE, the wrappers _beginthreadex and _endthreadex
|
||||
do not exist. The native Win32 routines must be used.
|
||||
|
||||
------------------------------------
|
||||
- in misc.c:
|
||||
|
||||
#ifdef NEED_DUPLICATEHANDLE
|
||||
/* DuplicateHandle does not exist on WinCE */
|
||||
self->threadH = GetCurrentThread();
|
||||
#else
|
||||
if( !DuplicateHandle(
|
||||
GetCurrentProcess(),
|
||||
GetCurrentThread(),
|
||||
GetCurrentProcess(),
|
||||
&self->threadH,
|
||||
0,
|
||||
FALSE,
|
||||
DUPLICATE_SAME_ACCESS ) )
|
||||
{
|
||||
free( self );
|
||||
return (NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
Rational: On WinCE, DuplicateHandle does not exist. I could not understand
|
||||
why DuplicateHandle must be used. It seems to me that getting the current
|
||||
thread handle with GetCurrentThread() is sufficient, and it seems to work
|
||||
perfectly fine, so maybe DuplicateHandle was just plain useless to begin with ?
|
||||
|
||||
------------------------------------
|
||||
- In private.c, added some code at the beginning of ptw32_processInitialize
|
||||
to detect the case of multiple calls to ptw32_processInitialize.
|
||||
|
||||
Rational: In order to debug pthread-win32, it is easier to compile
|
||||
it as a regular library (it is not possible to debug DLL's on winCE).
|
||||
In that case, the application must call ptw32_rocessInitialize()
|
||||
explicitely, to initialize pthread-win32. It is safer in this circumstance
|
||||
to handle the case where ptw32_processInitialize() is called on
|
||||
an already initialized library:
|
||||
|
||||
int
|
||||
ptw32_processInitialize (void)
|
||||
{
|
||||
if (ptw32_processInitialized) {
|
||||
/*
|
||||
* ignore if already initialized. this is useful for
|
||||
* programs that uses a non-dll pthread
|
||||
* library. such programs must call ptw32_processInitialize() explicitely,
|
||||
* since this initialization routine is automatically called only when
|
||||
* the dll is loaded.
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
ptw32_processInitialized = TRUE;
|
||||
[...]
|
||||
}
|
||||
|
||||
------------------------------------
|
||||
- in private.c, if macro NEED_FTIME is defined, add routines to
|
||||
convert timespec_to_filetime and filetime_to_timespec, and modified
|
||||
code that was using _ftime() to use Win32 API instead.
|
||||
|
||||
Rational: _ftime is not available on WinCE. It is necessary to use
|
||||
the native Win32 time API instead.
|
||||
|
||||
Note: the routine timespec_to_filetime is provided as a convenience and a mean
|
||||
to test that filetime_to_timespec works, but it is not used by the library.
|
||||
|
||||
------------------------------------
|
||||
- in semaphore.c, if macro NEED_SEM is defined, add code for the routines
|
||||
_increase_semaphore and _decrease_semaphore, and modify significantly
|
||||
the implementation of the semaphores so that it does not use CreateSemaphore.
|
||||
|
||||
Rational: CreateSemaphore is not available on WinCE. I had to re-implement
|
||||
semaphores using mutexes and Events.
|
||||
|
||||
Note: Only the semaphore routines that are used by pthread are implemented
|
||||
(i.e. signal conditions rely on a subset of the semaphores routines, and
|
||||
this subset works). Some other semaphore routines (e.g. sem_trywait) are
|
||||
not yet supported on my WinCE port (and since I don't need them, I am not
|
||||
planning to do anything about them).
|
||||
|
||||
------------------------------------
|
||||
- in tsd.c, changed the code that defines TLS_OUT_OF_INDEXES
|
||||
|
||||
/* TLS_OUT_OF_INDEXES not defined on WinCE */
|
||||
#ifndef TLS_OUT_OF_INDEXES
|
||||
#define TLS_OUT_OF_INDEXES 0xffffffff
|
||||
#endif
|
||||
|
||||
Rational: TLS_OUT_OF_INDEXES is not defined in any standard include file
|
||||
on WinCE.
|
||||
|
||||
------------------------------------
|
||||
- added file need_errno.h
|
||||
|
||||
Rational: On WinCE, there is no errno.h file. need_errno.h is just a
|
||||
copy of windows version of errno.h, with minor modifications due to the fact
|
||||
that some of the error codes are defined by the WinCE socket library.
|
||||
In pthread.h, if NEED_ERRNO is defined, the file need_errno.h is
|
||||
included (instead of <errno.h>).
|
||||
|
||||
|
||||
-- eof
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* attr.c
|
||||
*
|
||||
* Description:
|
||||
* This translation unit agregates operations on thread attribute objects.
|
||||
* It is used for inline optimisation.
|
||||
*
|
||||
* The included modules are used separately when static executable sizes
|
||||
* must be minimised.
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
#include "pthread_attr_init.c"
|
||||
#include "pthread_attr_destroy.c"
|
||||
#include "pthread_attr_getdetachstate.c"
|
||||
#include "pthread_attr_setdetachstate.c"
|
||||
#include "pthread_attr_getstackaddr.c"
|
||||
#include "pthread_attr_setstackaddr.c"
|
||||
#include "pthread_attr_getstacksize.c"
|
||||
#include "pthread_attr_setstacksize.c"
|
||||
#include "pthread_attr_getscope.c"
|
||||
#include "pthread_attr_setscope.c"
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* autostatic.c
|
||||
*
|
||||
* Description:
|
||||
* This translation unit implements static auto-init and auto-exit logic.
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#if defined(PTW32_STATIC_LIB)
|
||||
|
||||
#if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
|
||||
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
static void on_process_init(void)
|
||||
{
|
||||
pthread_win32_process_attach_np ();
|
||||
}
|
||||
|
||||
static void on_process_exit(void)
|
||||
{
|
||||
pthread_win32_thread_detach_np ();
|
||||
pthread_win32_process_detach_np ();
|
||||
}
|
||||
|
||||
#if defined(__MINGW64__) || defined(__MINGW32__)
|
||||
# define attribute_section(a) __attribute__((section(a)))
|
||||
#elif defined(_MSC_VER)
|
||||
# define attribute_section(a) __pragma(section(a,long,read)); __declspec(allocate(a))
|
||||
#endif
|
||||
|
||||
attribute_section(".ctors") void *gcc_ctor = on_process_init;
|
||||
attribute_section(".dtors") void *gcc_dtor = on_process_exit;
|
||||
|
||||
attribute_section(".CRT$XCU") void *msc_ctor = on_process_init;
|
||||
attribute_section(".CRT$XPU") void *msc_dtor = on_process_exit;
|
||||
|
||||
#endif /* defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER) */
|
||||
|
||||
#endif /* PTW32_STATIC_LIB */
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* pthread_barrier_destroy.c
|
||||
* barrier.c
|
||||
*
|
||||
* Description:
|
||||
* This translation unit implements barrier primitives.
|
||||
|
@ -9,58 +9,39 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
|
||||
int
|
||||
pthread_barrier_destroy (pthread_barrier_t * barrier)
|
||||
{
|
||||
int result = 0;
|
||||
pthread_barrier_t b;
|
||||
|
||||
if (barrier == NULL || *barrier == (pthread_barrier_t) PTW32_OBJECT_INVALID)
|
||||
{
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
b = *barrier;
|
||||
*barrier = NULL;
|
||||
|
||||
if (0 == (result = sem_destroy (&(b->semBarrierBreeched[0]))))
|
||||
{
|
||||
if (0 == (result = sem_destroy (&(b->semBarrierBreeched[1]))))
|
||||
{
|
||||
(void) free (b);
|
||||
return 0;
|
||||
}
|
||||
(void) sem_init (&(b->semBarrierBreeched[0]), b->pshared, 0);
|
||||
}
|
||||
|
||||
*barrier = b;
|
||||
return (result);
|
||||
}
|
||||
#include "pthread_barrier_init.c"
|
||||
#include "pthread_barrier_destroy.c"
|
||||
#include "pthread_barrier_wait.c"
|
||||
#include "pthread_barrierattr_init.c"
|
||||
#include "pthread_barrierattr_destroy.c"
|
||||
#include "pthread_barrierattr_getpshared.c"
|
||||
#include "pthread_barrierattr_setpshared.c"
|
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Devel|Win32">
|
||||
<Configuration>Devel</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Devel|x64">
|
||||
<Configuration>Devel</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0FAE817D-9A32-4830-857E-81DA57246E16}</ProjectGuid>
|
||||
<ProjectName>pthreads4w</ProjectName>
|
||||
<RootNamespace>pthreads4w</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
|
||||
<UseDebugLibraries Condition="'$(Configuration)'=='Debug'">true</UseDebugLibraries>
|
||||
<UseDebugLibraries Condition="'$(Configuration)'!='Debug'">false</UseDebugLibraries>
|
||||
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\DefaultProjectRootDir.props" />
|
||||
<Import Project="..\..\3rdparty.props" />
|
||||
<Import Project="..\..\..\common\vsprops\pthreads.props" />
|
||||
<Import Condition="'$(Configuration)'!='Release'" Project="..\..\..\common\vsprops\IncrementalLinking.props" />
|
||||
<Import Condition="'$(Configuration)'=='Debug'" Project="..\..\..\common\vsprops\CodeGen_Debug.props" />
|
||||
<Import Condition="'$(Configuration)'=='Devel'" Project="..\..\..\common\vsprops\CodeGen_Devel.props" />
|
||||
<Import Condition="'$(Configuration)'=='Release'" Project="..\..\..\common\vsprops\CodeGen_Release.props" />
|
||||
</ImportGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAVE_PTW32_CONFIG_H;PTW32_BUILD_INLINED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>PTW32_RC_MSC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Platform)'=='Win32'">PTW32_ARCHx86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Platform)'=='x64'">PTW32_ARCHx64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\pthread.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\config.h" />
|
||||
<ClInclude Include="..\context.h" />
|
||||
<ClInclude Include="..\implement.h" />
|
||||
<ClInclude Include="..\include\pthread.h" />
|
||||
<ClInclude Include="..\include\sched.h" />
|
||||
<ClInclude Include="..\include\semaphore.h" />
|
||||
<ClInclude Include="..\need_errno.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\version.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
|
@ -7,44 +7,44 @@
|
|||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\CDVDisop.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Config.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\libiso.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\CDVDiso.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\libiso.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="CDVDiso.rc">
|
||||
<ResourceCompile Include="..\version.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\pthread.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\context.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\implement.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\need_errno.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\pthread.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\sched.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\semaphore.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
; Build the pthreads library with the Digital Mars Compiler
|
||||
;
|
||||
set DMCDIR=c:\dm
|
||||
|
||||
; RELEASE
|
||||
%DMCDIR%\bin\dmc -D_WIN32_WINNT -D_MT -DHAVE_PTW32_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/NODEBUG -L/SU:WINDOWS
|
||||
|
||||
; DEBUG
|
||||
%DMCDIR%\bin\dmc -g -D_WIN32_WINNT -D_MT -DHAVE_PTW32_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:WINDOWS
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* cancel.c
|
||||
*
|
||||
* Description:
|
||||
* POSIX thread functions related to thread cancellation.
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
|
||||
#include "pthread_setcancelstate.c"
|
||||
#include "pthread_setcanceltype.c"
|
||||
#include "pthread_testcancel.c"
|
||||
#include "pthread_cancel.c"
|
|
@ -11,41 +11,41 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
|
||||
/*
|
||||
* The functions ptw32_pop_cleanup and ptw32_push_cleanup
|
||||
* are implemented here for applications written in C with no
|
||||
* SEH or C++ destructor support.
|
||||
* SEH or C++ destructor support.
|
||||
*/
|
||||
|
||||
#ifdef __CLEANUP_C
|
||||
|
||||
ptw32_cleanup_t *
|
||||
ptw32_pop_cleanup (int execute)
|
||||
/*
|
||||
|
@ -146,5 +146,3 @@ ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
|
|||
pthread_setspecific (ptw32_cleanupKey, (void *) cleanup);
|
||||
|
||||
} /* ptw32_push_cleanup */
|
||||
|
||||
#endif
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* condvar.c
|
||||
*
|
||||
* Description:
|
||||
* This translation unit implements condition variables and their primitives.
|
||||
*
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
#include "ptw32_cond_check_need_init.c"
|
||||
#include "pthread_condattr_init.c"
|
||||
#include "pthread_condattr_destroy.c"
|
||||
#include "pthread_condattr_getpshared.c"
|
||||
#include "pthread_condattr_setpshared.c"
|
||||
#include "pthread_cond_init.c"
|
||||
#include "pthread_cond_destroy.c"
|
||||
#include "pthread_cond_wait.c"
|
||||
#include "pthread_cond_signal.c"
|
|
@ -14,7 +14,7 @@
|
|||
#undef HAVE_SIGSET_T
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/* Define if you have the Borland TASM32 or compatible assembler. */
|
||||
#undef HAVE_TASM32
|
||||
|
@ -23,8 +23,7 @@
|
|||
#undef NEED_DUPLICATEHANDLE
|
||||
|
||||
/* Define if you don't have Win32 _beginthreadex. (eg. WinCE) */
|
||||
// PCSX2 : This is preferred when using the shared CRT, which we do! -- air
|
||||
#define NEED_CREATETHREAD
|
||||
#undef NEED_CREATETHREAD
|
||||
|
||||
/* Define if you don't have Win32 errno. (eg. WinCE) */
|
||||
#undef NEED_ERRNO
|
||||
|
@ -42,17 +41,31 @@
|
|||
#undef NEED_UNICODE_CONSTS
|
||||
|
||||
/* Define if your C (not C++) compiler supports "inline" functions. */
|
||||
#define HAVE_C_INLINE
|
||||
#undef HAVE_C_INLINE
|
||||
|
||||
/* Do we know about type mode_t? */
|
||||
#undef HAVE_MODE_T
|
||||
|
||||
/*
|
||||
* Define if GCC has atomic builtins, i.e. __sync_* intrinsics
|
||||
* __sync_lock_* is implemented in mingw32 gcc 4.5.2 at least
|
||||
* so this define does not turn those on or off. If you get an
|
||||
* error from __sync_lock* then consider upgrading your gcc.
|
||||
*/
|
||||
#undef HAVE_GCC_ATOMIC_BUILTINS
|
||||
|
||||
/* Define if you have the timespec struct */
|
||||
#undef HAVE_STRUCT_TIMESPEC
|
||||
|
||||
/* Define if you don't have the GetProcessAffinityMask() */
|
||||
#undef NEED_PROCESS_AFFINITY_MASK
|
||||
|
||||
/* Define if your version of Windows TLSGetValue() clears WSALastError
|
||||
* and calling SetLastError() isn't enough restore it. You'll also need to
|
||||
* link against wsock32.lib (or libwsock32.a for MinGW).
|
||||
*/
|
||||
#undef RETAIN_WSALASTERROR
|
||||
|
||||
/*
|
||||
# ----------------------------------------------------------------------
|
||||
# The library can be built with some alternative behaviour to better
|
||||
|
@ -95,37 +108,46 @@
|
|||
* If you find that these are incorrect or incomplete please report it
|
||||
* to the pthreads-win32 maintainer. Thanks.
|
||||
*********************************************************************/
|
||||
#ifdef WINCE
|
||||
#if defined(WINCE)
|
||||
#define NEED_DUPLICATEHANDLE
|
||||
#define NEED_CREATETHREAD
|
||||
#define NEED_ERRNO
|
||||
#define NEED_CALLOC
|
||||
#define NEED_FTIME
|
||||
//#define NEED_SEM
|
||||
/* #define NEED_SEM */
|
||||
#define NEED_UNICODE_CONSTS
|
||||
#define NEED_PROCESS_AFFINITY_MASK
|
||||
/* This may not be needed */
|
||||
#define RETAIN_WSALASTERROR
|
||||
#endif
|
||||
|
||||
#ifdef _UWIN
|
||||
#if defined(_UWIN)
|
||||
#define HAVE_MODE_T
|
||||
#define HAVE_STRUCT_TIMESPEC
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__)
|
||||
#define HAVE_C_INLINE
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#if defined(__MINGW64__)
|
||||
#define HAVE_MODE_T
|
||||
#define HAVE_STRUCT_TIMESPEC
|
||||
#elif defined(__MINGW32__)
|
||||
#define HAVE_MODE_T
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#if _MSC_VER >= 1900
|
||||
#define HAVE_STRUCT_TIMESPEC
|
||||
#endif
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
#if defined(__BORLANDC__)
|
||||
#endif
|
||||
|
||||
#ifdef __DMC__
|
||||
#if defined(__WATCOMC__)
|
||||
#endif
|
||||
|
||||
#if defined(__DMC__)
|
||||
#define HAVE_SIGNAL_H
|
||||
#define HAVE_C_INLINE
|
||||
#endif
|
|
@ -1,50 +1,53 @@
|
|||
/*
|
||||
* ptw32_new.c
|
||||
* context.h
|
||||
*
|
||||
* Description:
|
||||
* This translation unit provides platform-specific cancelation functionality.
|
||||
* POSIX thread macros related to thread cancellation.
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#ifndef PTW32_CONTEXT_H
|
||||
#define PTW32_CONTEXT_H
|
||||
|
||||
#if defined(_M_IX86) || defined(_X86_)
|
||||
#undef PTW32_PROGCTR
|
||||
|
||||
#if defined(_M_IX86) || (defined(_X86_) && !defined(__amd64__))
|
||||
#define PTW32_PROGCTR(Context) ((Context).Eip)
|
||||
#endif
|
||||
|
||||
#if defined (_M_IA64)
|
||||
#if defined (_M_IA64) || defined(_IA64)
|
||||
#define PTW32_PROGCTR(Context) ((Context).StIIP)
|
||||
#endif
|
||||
|
||||
#if defined(_MIPS_)
|
||||
#if defined(_MIPS_) || defined(MIPS)
|
||||
#define PTW32_PROGCTR(Context) ((Context).Fir)
|
||||
#endif
|
||||
|
||||
|
@ -56,65 +59,16 @@
|
|||
#define PTW32_PROGCTR(Context) ((Context).Iar)
|
||||
#endif
|
||||
|
||||
#if defined(_AMD64_)
|
||||
#if defined(_AMD64_) || defined(__amd64__)
|
||||
#define PTW32_PROGCTR(Context) ((Context).Rip)
|
||||
#endif
|
||||
|
||||
#if defined(_ARM_) || defined(ARM)
|
||||
#define PTW32_PROGCTR(Context) ((Context).Pc)
|
||||
#endif
|
||||
|
||||
#if !defined(PTW32_PROGCTR)
|
||||
#error Module contains CPU-specific code; modify and recompile.
|
||||
#endif
|
||||
|
||||
static void
|
||||
ptw32_cancel_self (void)
|
||||
{
|
||||
ptw32_throw (PTW32_EPS_CANCEL);
|
||||
|
||||
/* Never reached */
|
||||
}
|
||||
|
||||
static void CALLBACK
|
||||
ptw32_cancel_callback (DWORD_PTR unused)
|
||||
{
|
||||
ptw32_throw (PTW32_EPS_CANCEL);
|
||||
|
||||
/* Never reached */
|
||||
}
|
||||
|
||||
/*
|
||||
* ptw32_RegisterCancelation() -
|
||||
* Must have args of same type as QueueUserAPCEx because this function
|
||||
* is a substitute for QueueUserAPCEx if it's not available.
|
||||
*/
|
||||
DWORD
|
||||
ptw32_RegisterCancelation (PAPCFUNC unused1, HANDLE threadH, DWORD unused2)
|
||||
{
|
||||
CONTEXT context;
|
||||
|
||||
context.ContextFlags = CONTEXT_CONTROL;
|
||||
GetThreadContext (threadH, &context);
|
||||
PTW32_PROGCTR (context) = (DWORD_PTR) ptw32_cancel_self;
|
||||
SetThreadContext (threadH, &context);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ptw32_PrepCancel( ptw32_thread_t* tp )
|
||||
{
|
||||
HANDLE threadH = tp->threadH;
|
||||
|
||||
SuspendThread (threadH);
|
||||
|
||||
if (WaitForSingleObject (threadH, 0) == WAIT_TIMEOUT)
|
||||
{
|
||||
tp->state = PThreadStateCanceling;
|
||||
tp->cancelState = PTHREAD_CANCEL_DISABLE;
|
||||
/*
|
||||
* If alertdrv and QueueUserAPCEx is available then the following
|
||||
* will result in a call to QueueUserAPCEx with the args given, otherwise
|
||||
* this will result in a call to ptw32_RegisterCancelation and only
|
||||
* the threadH arg will be used.
|
||||
*/
|
||||
ptw32_register_cancelation (ptw32_cancel_callback, threadH, 0);
|
||||
(void) pthread_mutex_unlock (&tp->cancelLock);
|
||||
ResumeThread (threadH);
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -10,40 +10,41 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#ifndef _UWIN
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
#if ! defined(_UWIN) && ! defined(WINCE)
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
pthread_create (pthread_t * tid,
|
||||
const pthread_attr_t * attr,
|
||||
void *(*start) (void *), void *arg)
|
||||
void *(PTW32_CDECL *start) (void *), void *arg)
|
||||
/*
|
||||
* ------------------------------------------------------
|
||||
* DOCPUBLIC
|
||||
|
@ -89,7 +90,7 @@ pthread_create (pthread_t * tid,
|
|||
int result = EAGAIN;
|
||||
int run = PTW32_TRUE;
|
||||
ThreadParms *parms = NULL;
|
||||
long stackSize;
|
||||
unsigned int stackSize;
|
||||
int priority;
|
||||
pthread_t self;
|
||||
|
||||
|
@ -141,7 +142,7 @@ pthread_create (pthread_t * tid,
|
|||
|
||||
if (a != NULL)
|
||||
{
|
||||
stackSize = a->stacksize;
|
||||
stackSize = (unsigned int)a->stacksize;
|
||||
tp->detachState = a->detachstate;
|
||||
priority = a->param.sched_priority;
|
||||
|
||||
|
@ -199,12 +200,12 @@ pthread_create (pthread_t * tid,
|
|||
* finished with it here.
|
||||
*/
|
||||
|
||||
#if ! defined (__MINGW32__) || defined (__MSVCRT__) || defined (__DMC__)
|
||||
#if ! (defined (__MINGW64__) || defined(__MINGW32__)) || defined (__MSVCRT__) || defined (__DMC__)
|
||||
|
||||
tp->threadH =
|
||||
threadH =
|
||||
(HANDLE) _beginthreadex ((void *) NULL, /* No security info */
|
||||
(unsigned) stackSize, /* default stack size */
|
||||
stackSize, /* default stack size */
|
||||
ptw32_threadStart,
|
||||
parms,
|
||||
(unsigned)
|
||||
|
@ -224,47 +225,50 @@ pthread_create (pthread_t * tid,
|
|||
}
|
||||
}
|
||||
|
||||
#else /* __MINGW32__ && ! __MSVCRT__ */
|
||||
#else
|
||||
|
||||
/*
|
||||
* This lock will force pthread_threadStart() to wait until we have
|
||||
* the thread handle and have set the priority.
|
||||
*/
|
||||
(void) pthread_mutex_lock (&tp->cancelLock);
|
||||
{
|
||||
ptw32_mcs_local_node_t stateLock;
|
||||
|
||||
tp->threadH =
|
||||
threadH =
|
||||
(HANDLE) _beginthread (ptw32_threadStart, (unsigned) stackSize, /* default stack size */
|
||||
parms);
|
||||
/*
|
||||
* This lock will force pthread_threadStart() to wait until we have
|
||||
* the thread handle and have set the priority.
|
||||
*/
|
||||
ptw32_mcs_lock_acquire(&tp->stateLock, &stateLock);
|
||||
|
||||
/*
|
||||
* Make the return code match _beginthreadex's.
|
||||
*/
|
||||
if (threadH == (HANDLE) - 1L)
|
||||
{
|
||||
tp->threadH = threadH = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!run)
|
||||
{
|
||||
/*
|
||||
* beginthread does not allow for create flags, so we do it now.
|
||||
* Note that beginthread itself creates the thread in SUSPENDED
|
||||
* mode, and then calls ResumeThread to start it.
|
||||
*/
|
||||
SuspendThread (threadH);
|
||||
}
|
||||
tp->threadH =
|
||||
threadH =
|
||||
(HANDLE) _beginthread (ptw32_threadStart, stackSize, /* default stack size */
|
||||
parms);
|
||||
|
||||
if (a != NULL)
|
||||
{
|
||||
(void) ptw32_setthreadpriority (thread, SCHED_OTHER, priority);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Make the return code match _beginthreadex's.
|
||||
*/
|
||||
if (threadH == (HANDLE) - 1L)
|
||||
{
|
||||
tp->threadH = threadH = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!run)
|
||||
{
|
||||
/*
|
||||
* beginthread does not allow for create flags, so we do it now.
|
||||
* Note that beginthread itself creates the thread in SUSPENDED
|
||||
* mode, and then calls ResumeThread to start it.
|
||||
*/
|
||||
SuspendThread (threadH);
|
||||
}
|
||||
|
||||
if (a != NULL)
|
||||
{
|
||||
(void) ptw32_setthreadpriority (thread, SCHED_OTHER, priority);
|
||||
}
|
||||
}
|
||||
|
||||
(void) pthread_mutex_unlock (&tp->cancelLock);
|
||||
|
||||
#endif /* __MINGW32__ && ! __MSVCRT__ */
|
||||
ptw32_mcs_lock_release (&stateLock);
|
||||
}
|
||||
#endif
|
||||
|
||||
result = (threadH != 0) ? 0 : EAGAIN;
|
||||
|
||||
|
@ -295,7 +299,7 @@ FAIL0:
|
|||
*tid = thread;
|
||||
}
|
||||
|
||||
#ifdef _UWIN
|
||||
#if defined(_UWIN)
|
||||
if (result == 0)
|
||||
pthread_count++;
|
||||
#endif
|
|
@ -9,45 +9,45 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#include <assert.h>
|
||||
#if !defined(PTW32_STATIC_LIB)
|
||||
|
||||
#ifndef PTW32_STATIC_LIB
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/*
|
||||
#if defined(_MSC_VER)
|
||||
/*
|
||||
* lpvReserved yields an unreferenced formal parameter;
|
||||
* ignore it
|
||||
*/
|
||||
#pragma warning( disable : 4100 )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
/*
|
||||
* Dear c++: Please don't mangle this name. -thanks
|
||||
*/
|
||||
|
@ -82,9 +82,6 @@ DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
|
|||
case DLL_PROCESS_DETACH:
|
||||
(void) pthread_win32_thread_detach_np ();
|
||||
result = pthread_win32_process_detach_np ();
|
||||
|
||||
assert(ptw32_testcancel_enable == 0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -10,35 +10,36 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
|
||||
#if defined(NEED_ERRNO)
|
||||
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
static int reallyBad = ENOMEM;
|
||||
|
||||
/*
|
||||
|
@ -73,7 +74,7 @@ _errno (void)
|
|||
pthread_t self;
|
||||
int *result;
|
||||
|
||||
if ((self = pthread_self ()) == NULL)
|
||||
if ((self = pthread_self ()).p == NULL)
|
||||
{
|
||||
/*
|
||||
* Yikes! unable to allocate a thread!
|
||||
|
@ -83,7 +84,7 @@ _errno (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
result = &(self->ptErrno);
|
||||
result = (int *)(&self.p->exitStatus);
|
||||
}
|
||||
|
||||
return (result);
|
|
@ -10,33 +10,34 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#ifndef _UWIN
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
#if ! defined(_UWIN) && ! defined(WINCE)
|
||||
# include <process.h>
|
||||
#endif
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* fork.c
|
||||
*
|
||||
* Description:
|
||||
* Implementation of fork() for POSIX threads.
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
|
@ -10,32 +10,33 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#include "ptw32pch.h"
|
||||
#include "pthread.h"
|
||||
#include "implement.h"
|
||||
|
||||
|
||||
int ptw32_processInitialized = PTW32_FALSE;
|
||||
|
@ -46,27 +47,17 @@ pthread_key_t ptw32_cleanupKey = NULL;
|
|||
pthread_cond_t ptw32_cond_list_head = NULL;
|
||||
pthread_cond_t ptw32_cond_list_tail = NULL;
|
||||
|
||||
long ptw32_testcancel_enable = 0;
|
||||
|
||||
int ptw32_concurrency = 0;
|
||||
|
||||
/* What features have been auto-detaected */
|
||||
/* What features have been auto-detected */
|
||||
int ptw32_features = 0;
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Function pointer to InterlockedCompareExchange if it exists, otherwise
|
||||
* it will be set at runtime to a substitute local version with the same
|
||||
* functionality but may be architecture specific.
|
||||
* Global [process wide] thread sequence Number
|
||||
*/
|
||||
PTW32_INTERLOCKED_LONG
|
||||
(WINAPI * ptw32_interlocked_compare_exchange) (PTW32_INTERLOCKED_LPLONG,
|
||||
PTW32_INTERLOCKED_LONG,
|
||||
PTW32_INTERLOCKED_LONG) =
|
||||
NULL;
|
||||
#endif
|
||||
unsigned __int64 ptw32_threadSeqNumber = 0;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Function pointer to QueueUserAPCEx if it exists, otherwise
|
||||
* it will be set at runtime to a substitute routine which cannot unblock
|
||||
* blocked threads.
|
||||
|
@ -76,39 +67,39 @@ DWORD (*ptw32_register_cancelation) (PAPCFUNC, HANDLE, DWORD) = NULL;
|
|||
/*
|
||||
* Global lock for managing pthread_t struct reuse.
|
||||
*/
|
||||
CRITICAL_SECTION ptw32_thread_reuse_lock;
|
||||
ptw32_mcs_lock_t ptw32_thread_reuse_lock = 0;
|
||||
|
||||
/*
|
||||
* Global lock for testing internal state of statically declared mutexes.
|
||||
*/
|
||||
CRITICAL_SECTION ptw32_mutex_test_init_lock;
|
||||
ptw32_mcs_lock_t ptw32_mutex_test_init_lock = 0;
|
||||
|
||||
/*
|
||||
* Global lock for testing internal state of PTHREAD_COND_INITIALIZER
|
||||
* created condition variables.
|
||||
*/
|
||||
CRITICAL_SECTION ptw32_cond_test_init_lock;
|
||||
ptw32_mcs_lock_t ptw32_cond_test_init_lock = 0;
|
||||
|
||||
/*
|
||||
* Global lock for testing internal state of PTHREAD_RWLOCK_INITIALIZER
|
||||
* created read/write locks.
|
||||
*/
|
||||
CRITICAL_SECTION ptw32_rwlock_test_init_lock;
|
||||
ptw32_mcs_lock_t ptw32_rwlock_test_init_lock = 0;
|
||||
|
||||
/*
|
||||
* Global lock for testing internal state of PTHREAD_SPINLOCK_INITIALIZER
|
||||
* created spin locks.
|
||||
*/
|
||||
CRITICAL_SECTION ptw32_spinlock_test_init_lock;
|
||||
ptw32_mcs_lock_t ptw32_spinlock_test_init_lock = 0;
|
||||
|
||||
/*
|
||||
* Global lock for condition variable linked list. The list exists
|
||||
* to wake up CVs when a WM_TIMECHANGE message arrives. See
|
||||
* w32_TimeChangeHandler.c.
|
||||
*/
|
||||
CRITICAL_SECTION ptw32_cond_list_lock;
|
||||
ptw32_mcs_lock_t ptw32_cond_list_lock = 0;
|
||||
|
||||
#ifdef _UWIN
|
||||
#if defined(_UWIN)
|
||||
/*
|
||||
* Keep a count of the number of threads.
|
||||
*/
|
|
@ -0,0 +1,943 @@
|
|||
/*
|
||||
* implement.h
|
||||
*
|
||||
* Definitions that don't need to be public.
|
||||
*
|
||||
* Keeps all the internals out of pthread.h
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
* Contact Email: Ross.Johnson@homemail.com.au
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
|
||||
#if !defined(_IMPLEMENT_H)
|
||||
#define _IMPLEMENT_H
|
||||
|
||||
#if !defined(_WIN32_WINNT)
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
/*
|
||||
* In case windows.h doesn't define it (e.g. WinCE perhaps)
|
||||
*/
|
||||
#if defined(WINCE)
|
||||
typedef VOID (APIENTRY *PAPCFUNC)(DWORD dwParam);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* note: ETIMEDOUT is correctly defined in winsock.h
|
||||
*/
|
||||
#include <winsock.h>
|
||||
|
||||
/*
|
||||
* In case ETIMEDOUT hasn't been defined above somehow.
|
||||
*/
|
||||
#if !defined(ETIMEDOUT)
|
||||
# define ETIMEDOUT 10060 /* This is the value in winsock.h. */
|
||||
#endif
|
||||
|
||||
#if !defined(malloc)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#if defined(__CLEANUP_C)
|
||||
# include <setjmp.h>
|
||||
#endif
|
||||
|
||||
#if !defined(INT_MAX)
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
/* use local include files during development */
|
||||
#include "semaphore.h"
|
||||
#include "sched.h"
|
||||
|
||||
#if defined(HAVE_C_INLINE) || defined(__cplusplus)
|
||||
#define INLINE inline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1300
|
||||
/*
|
||||
* MSVC 6 does not use the "volatile" qualifier
|
||||
*/
|
||||
#define PTW32_INTERLOCKED_VOLATILE
|
||||
#else
|
||||
#define PTW32_INTERLOCKED_VOLATILE volatile
|
||||
#endif
|
||||
#define PTW32_INTERLOCKED_LONG long
|
||||
#define PTW32_INTERLOCKED_SIZE size_t
|
||||
#define PTW32_INTERLOCKED_PVOID PVOID
|
||||
#define PTW32_INTERLOCKED_LONGPTR PTW32_INTERLOCKED_VOLATILE long*
|
||||
#define PTW32_INTERLOCKED_SIZEPTR PTW32_INTERLOCKED_VOLATILE size_t*
|
||||
#define PTW32_INTERLOCKED_PVOID_PTR PTW32_INTERLOCKED_VOLATILE PVOID*
|
||||
|
||||
#if defined(__MINGW64__) || defined(__MINGW32__)
|
||||
# include <stdint.h>
|
||||
#elif defined(__BORLANDC__)
|
||||
# define int64_t ULONGLONG
|
||||
#else
|
||||
# define int64_t _int64
|
||||
# if defined(_MSC_VER) && _MSC_VER < 1300
|
||||
typedef long intptr_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/*
|
||||
* This enumeration represents the state of the thread;
|
||||
* The thread is still "alive" if the numeric value of the
|
||||
* state is greater or equal "PThreadStateRunning".
|
||||
*/
|
||||
PThreadStateInitial = 0, /* Thread not running */
|
||||
PThreadStateRunning, /* Thread alive & kicking */
|
||||
PThreadStateSuspended, /* Thread alive but suspended */
|
||||
PThreadStateCancelPending, /* Thread alive but */
|
||||
/* has cancelation pending. */
|
||||
PThreadStateCanceling, /* Thread alive but is */
|
||||
/* in the process of terminating */
|
||||
/* due to a cancellation request */
|
||||
PThreadStateExiting, /* Thread alive but exiting */
|
||||
/* due to an exception */
|
||||
PThreadStateLast, /* All handlers have been run and now */
|
||||
/* final cleanup can be done. */
|
||||
PThreadStateReuse /* In reuse pool. */
|
||||
}
|
||||
PThreadState;
|
||||
|
||||
typedef struct ptw32_mcs_node_t_ ptw32_mcs_local_node_t;
|
||||
typedef struct ptw32_mcs_node_t_* ptw32_mcs_lock_t;
|
||||
typedef struct ptw32_robust_node_t_ ptw32_robust_node_t;
|
||||
typedef struct ptw32_thread_t_ ptw32_thread_t;
|
||||
|
||||
|
||||
struct ptw32_thread_t_
|
||||
{
|
||||
unsigned __int64 seqNumber; /* Process-unique thread sequence number */
|
||||
HANDLE threadH; /* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
|
||||
pthread_t ptHandle; /* This thread's permanent pthread_t handle */
|
||||
ptw32_thread_t * prevReuse; /* Links threads on reuse stack */
|
||||
volatile PThreadState state;
|
||||
ptw32_mcs_lock_t threadLock; /* Used for serialised access to public thread state */
|
||||
ptw32_mcs_lock_t stateLock; /* Used for async-cancel safety */
|
||||
HANDLE cancelEvent;
|
||||
void *exitStatus;
|
||||
void *parms;
|
||||
void *keys;
|
||||
void *nextAssoc;
|
||||
#if defined(__CLEANUP_C)
|
||||
jmp_buf start_mark; /* Jump buffer follows void* so should be aligned */
|
||||
#endif /* __CLEANUP_C */
|
||||
#if defined(HAVE_SIGSET_T)
|
||||
sigset_t sigmask;
|
||||
#endif /* HAVE_SIGSET_T */
|
||||
ptw32_mcs_lock_t
|
||||
robustMxListLock; /* robustMxList lock */
|
||||
ptw32_robust_node_t*
|
||||
robustMxList; /* List of currenty held robust mutexes */
|
||||
int ptErrno;
|
||||
int detachState;
|
||||
int sched_priority; /* As set, not as currently is */
|
||||
int cancelState;
|
||||
int cancelType;
|
||||
int implicit:1;
|
||||
DWORD thread; /* Win32 thread ID */
|
||||
#if defined(_UWIN)
|
||||
DWORD dummy[5];
|
||||
#endif
|
||||
size_t align; /* Force alignment if this struct is packed */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Special value to mark attribute objects as valid.
|
||||
*/
|
||||
#define PTW32_ATTR_VALID ((unsigned long) 0xC4C0FFEE)
|
||||
|
||||
struct pthread_attr_t_
|
||||
{
|
||||
unsigned long valid;
|
||||
void *stackaddr;
|
||||
size_t stacksize;
|
||||
int detachstate;
|
||||
struct sched_param param;
|
||||
int inheritsched;
|
||||
int contentionscope;
|
||||
#if defined(HAVE_SIGSET_T)
|
||||
sigset_t sigmask;
|
||||
#endif /* HAVE_SIGSET_T */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* ====================
|
||||
* ====================
|
||||
* Semaphores, Mutexes and Condition Variables
|
||||
* ====================
|
||||
* ====================
|
||||
*/
|
||||
|
||||
struct sem_t_
|
||||
{
|
||||
int value;
|
||||
pthread_mutex_t lock;
|
||||
HANDLE sem;
|
||||
#if defined(NEED_SEM)
|
||||
int leftToUnblock;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define PTW32_OBJECT_AUTO_INIT ((void *)(size_t) -1)
|
||||
#define PTW32_OBJECT_INVALID NULL
|
||||
|
||||
struct pthread_mutex_t_
|
||||
{
|
||||
LONG lock_idx; /* Provides exclusive access to mutex state
|
||||
via the Interlocked* mechanism.
|
||||
0: unlocked/free.
|
||||
1: locked - no other waiters.
|
||||
-1: locked - with possible other waiters.
|
||||
*/
|
||||
int recursive_count; /* Number of unlocks a thread needs to perform
|
||||
before the lock is released (recursive
|
||||
mutexes only). */
|
||||
int kind; /* Mutex type. */
|
||||
pthread_t ownerThread;
|
||||
HANDLE event; /* Mutex release notification to waiting
|
||||
threads. */
|
||||
ptw32_robust_node_t*
|
||||
robustNode; /* Extra state for robust mutexes */
|
||||
};
|
||||
|
||||
enum ptw32_robust_state_t_
|
||||
{
|
||||
PTW32_ROBUST_CONSISTENT,
|
||||
PTW32_ROBUST_INCONSISTENT,
|
||||
PTW32_ROBUST_NOTRECOVERABLE
|
||||
};
|
||||
|
||||
typedef enum ptw32_robust_state_t_ ptw32_robust_state_t;
|
||||
|
||||
/*
|
||||
* Node used to manage per-thread lists of currently-held robust mutexes.
|
||||
*/
|
||||
struct ptw32_robust_node_t_
|
||||
{
|
||||
pthread_mutex_t mx;
|
||||
ptw32_robust_state_t stateInconsistent;
|
||||
ptw32_robust_node_t* prev;
|
||||
ptw32_robust_node_t* next;
|
||||
};
|
||||
|
||||
struct pthread_mutexattr_t_
|
||||
{
|
||||
int pshared;
|
||||
int kind;
|
||||
int robustness;
|
||||
};
|
||||
|
||||
/*
|
||||
* Possible values, other than PTW32_OBJECT_INVALID,
|
||||
* for the "interlock" element in a spinlock.
|
||||
*
|
||||
* In this implementation, when a spinlock is initialised,
|
||||
* the number of cpus available to the process is checked.
|
||||
* If there is only one cpu then "interlock" is set equal to
|
||||
* PTW32_SPIN_USE_MUTEX and u.mutex is an initialised mutex.
|
||||
* If the number of cpus is greater than 1 then "interlock"
|
||||
* is set equal to PTW32_SPIN_UNLOCKED and the number is
|
||||
* stored in u.cpus. This arrangement allows the spinlock
|
||||
* routines to attempt an InterlockedCompareExchange on "interlock"
|
||||
* immediately and, if that fails, to try the inferior mutex.
|
||||
*
|
||||
* "u.cpus" isn't used for anything yet, but could be used at
|
||||
* some point to optimise spinlock behaviour.
|
||||
*/
|
||||
#define PTW32_SPIN_INVALID (0)
|
||||
#define PTW32_SPIN_UNLOCKED (1)
|
||||
#define PTW32_SPIN_LOCKED (2)
|
||||
#define PTW32_SPIN_USE_MUTEX (3)
|
||||
|
||||
struct pthread_spinlock_t_
|
||||
{
|
||||
long interlock; /* Locking element for multi-cpus. */
|
||||
union
|
||||
{
|
||||
int cpus; /* No. of cpus if multi cpus, or */
|
||||
pthread_mutex_t mutex; /* mutex if single cpu. */
|
||||
} u;
|
||||
};
|
||||
|
||||
/*
|
||||
* MCS lock queue node - see ptw32_MCS_lock.c
|
||||
*/
|
||||
struct ptw32_mcs_node_t_
|
||||
{
|
||||
struct ptw32_mcs_node_t_ **lock; /* ptr to tail of queue */
|
||||
struct ptw32_mcs_node_t_ *next; /* ptr to successor in queue */
|
||||
HANDLE readyFlag; /* set after lock is released by
|
||||
predecessor */
|
||||
HANDLE nextFlag; /* set after 'next' ptr is set by
|
||||
successor */
|
||||
};
|
||||
|
||||
|
||||
struct pthread_barrier_t_
|
||||
{
|
||||
unsigned int nCurrentBarrierHeight;
|
||||
unsigned int nInitialBarrierHeight;
|
||||
int pshared;
|
||||
sem_t semBarrierBreeched;
|
||||
ptw32_mcs_lock_t lock;
|
||||
ptw32_mcs_local_node_t proxynode;
|
||||
};
|
||||
|
||||
struct pthread_barrierattr_t_
|
||||
{
|
||||
int pshared;
|
||||
};
|
||||
|
||||
struct pthread_key_t_
|
||||
{
|
||||
DWORD key;
|
||||
void (PTW32_CDECL *destructor) (void *);
|
||||
ptw32_mcs_lock_t keyLock;
|
||||
void *threads;
|
||||
};
|
||||
|
||||
|
||||
typedef struct ThreadParms ThreadParms;
|
||||
|
||||
struct ThreadParms
|
||||
{
|
||||
pthread_t tid;
|
||||
void *(PTW32_CDECL *start) (void *);
|
||||
void *arg;
|
||||
};
|
||||
|
||||
|
||||
struct pthread_cond_t_
|
||||
{
|
||||
long nWaitersBlocked; /* Number of threads blocked */
|
||||
long nWaitersGone; /* Number of threads timed out */
|
||||
long nWaitersToUnblock; /* Number of threads to unblock */
|
||||
sem_t semBlockQueue; /* Queue up threads waiting for the */
|
||||
/* condition to become signalled */
|
||||
sem_t semBlockLock; /* Semaphore that guards access to */
|
||||
/* | waiters blocked count/block queue */
|
||||
/* +-> Mandatory Sync.LEVEL-1 */
|
||||
pthread_mutex_t mtxUnblockLock; /* Mutex that guards access to */
|
||||
/* | waiters (to)unblock(ed) counts */
|
||||
/* +-> Optional* Sync.LEVEL-2 */
|
||||
pthread_cond_t next; /* Doubly linked list */
|
||||
pthread_cond_t prev;
|
||||
};
|
||||
|
||||
|
||||
struct pthread_condattr_t_
|
||||
{
|
||||
int pshared;
|
||||
};
|
||||
|
||||
#define PTW32_RWLOCK_MAGIC 0xfacade2
|
||||
|
||||
struct pthread_rwlock_t_
|
||||
{
|
||||
pthread_mutex_t mtxExclusiveAccess;
|
||||
pthread_mutex_t mtxSharedAccessCompleted;
|
||||
pthread_cond_t cndSharedAccessCompleted;
|
||||
int nSharedAccessCount;
|
||||
int nExclusiveAccessCount;
|
||||
int nCompletedSharedAccessCount;
|
||||
int nMagic;
|
||||
};
|
||||
|
||||
struct pthread_rwlockattr_t_
|
||||
{
|
||||
int pshared;
|
||||
};
|
||||
|
||||
typedef struct ThreadKeyAssoc ThreadKeyAssoc;
|
||||
|
||||
struct ThreadKeyAssoc
|
||||
{
|
||||
/*
|
||||
* Purpose:
|
||||
* This structure creates an association between a thread and a key.
|
||||
* It is used to implement the implicit invocation of a user defined
|
||||
* destroy routine for thread specific data registered by a user upon
|
||||
* exiting a thread.
|
||||
*
|
||||
* Graphically, the arrangement is as follows, where:
|
||||
*
|
||||
* K - Key with destructor
|
||||
* (head of chain is key->threads)
|
||||
* T - Thread that has called pthread_setspecific(Kn)
|
||||
* (head of chain is thread->keys)
|
||||
* A - Association. Each association is a node at the
|
||||
* intersection of two doubly-linked lists.
|
||||
*
|
||||
* T1 T2 T3
|
||||
* | | |
|
||||
* | | |
|
||||
* K1 -----+-----A-----A----->
|
||||
* | | |
|
||||
* | | |
|
||||
* K2 -----A-----A-----+----->
|
||||
* | | |
|
||||
* | | |
|
||||
* K3 -----A-----+-----A----->
|
||||
* | | |
|
||||
* | | |
|
||||
* V V V
|
||||
*
|
||||
* Access to the association is guarded by two locks: the key's
|
||||
* general lock (guarding the row) and the thread's general
|
||||
* lock (guarding the column). This avoids the need for a
|
||||
* dedicated lock for each association, which not only consumes
|
||||
* more handles but requires that the lock resources persist
|
||||
* until both the key is deleted and the thread has called the
|
||||
* destructor. The two-lock arrangement allows those resources
|
||||
* to be freed as soon as either thread or key is concluded.
|
||||
*
|
||||
* To avoid deadlock, whenever both locks are required both the
|
||||
* key and thread locks are acquired consistently in the order
|
||||
* "key lock then thread lock". An exception to this exists
|
||||
* when a thread calls the destructors, however, this is done
|
||||
* carefully (but inelegantly) to avoid deadlock.
|
||||
*
|
||||
* An association is created when a thread first calls
|
||||
* pthread_setspecific() on a key that has a specified
|
||||
* destructor.
|
||||
*
|
||||
* An association is destroyed either immediately after the
|
||||
* thread calls the key destructor function on thread exit, or
|
||||
* when the key is deleted.
|
||||
*
|
||||
* Attributes:
|
||||
* thread
|
||||
* reference to the thread that owns the
|
||||
* association. This is actually the pointer to the
|
||||
* thread struct itself. Since the association is
|
||||
* destroyed before the thread exits, this can never
|
||||
* point to a different logical thread to the one that
|
||||
* created the assoc, i.e. after thread struct reuse.
|
||||
*
|
||||
* key
|
||||
* reference to the key that owns the association.
|
||||
*
|
||||
* nextKey
|
||||
* The pthread_t->keys attribute is the head of a
|
||||
* chain of associations that runs through the nextKey
|
||||
* link. This chain provides the 1 to many relationship
|
||||
* between a pthread_t and all pthread_key_t on which
|
||||
* it called pthread_setspecific.
|
||||
*
|
||||
* prevKey
|
||||
* Similarly.
|
||||
*
|
||||
* nextThread
|
||||
* The pthread_key_t->threads attribute is the head of
|
||||
* a chain of associations that runs through the
|
||||
* nextThreads link. This chain provides the 1 to many
|
||||
* relationship between a pthread_key_t and all the
|
||||
* PThreads that have called pthread_setspecific for
|
||||
* this pthread_key_t.
|
||||
*
|
||||
* prevThread
|
||||
* Similarly.
|
||||
*
|
||||
* Notes:
|
||||
* 1) As soon as either the key or the thread is no longer
|
||||
* referencing the association, it can be destroyed. The
|
||||
* association will be removed from both chains.
|
||||
*
|
||||
* 2) Under WIN32, an association is only created by
|
||||
* pthread_setspecific if the user provided a
|
||||
* destroyRoutine when they created the key.
|
||||
*
|
||||
*
|
||||
*/
|
||||
ptw32_thread_t * thread;
|
||||
pthread_key_t key;
|
||||
ThreadKeyAssoc *nextKey;
|
||||
ThreadKeyAssoc *nextThread;
|
||||
ThreadKeyAssoc *prevKey;
|
||||
ThreadKeyAssoc *prevThread;
|
||||
};
|
||||
|
||||
|
||||
#if defined(__CLEANUP_SEH)
|
||||
/*
|
||||
* --------------------------------------------------------------
|
||||
* MAKE_SOFTWARE_EXCEPTION
|
||||
* This macro constructs a software exception code following
|
||||
* the same format as the standard Win32 error codes as defined
|
||||
* in WINERROR.H
|
||||
* Values are 32 bit values laid out as follows:
|
||||
*
|
||||
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
|
||||
* +---+-+-+-----------------------+-------------------------------+
|
||||
* |Sev|C|R| Facility | Code |
|
||||
* +---+-+-+-----------------------+-------------------------------+
|
||||
*
|
||||
* Severity Values:
|
||||
*/
|
||||
#define SE_SUCCESS 0x00
|
||||
#define SE_INFORMATION 0x01
|
||||
#define SE_WARNING 0x02
|
||||
#define SE_ERROR 0x03
|
||||
|
||||
#define MAKE_SOFTWARE_EXCEPTION( _severity, _facility, _exception ) \
|
||||
( (DWORD) ( ( (_severity) << 30 ) | /* Severity code */ \
|
||||
( 1 << 29 ) | /* MS=0, User=1 */ \
|
||||
( 0 << 28 ) | /* Reserved */ \
|
||||
( (_facility) << 16 ) | /* Facility Code */ \
|
||||
( (_exception) << 0 ) /* Exception Code */ \
|
||||
) )
|
||||
|
||||
/*
|
||||
* We choose one specific Facility/Error code combination to
|
||||
* identify our software exceptions vs. WIN32 exceptions.
|
||||
* We store our actual component and error code within
|
||||
* the optional information array.
|
||||
*/
|
||||
#define EXCEPTION_PTW32_SERVICES \
|
||||
MAKE_SOFTWARE_EXCEPTION( SE_ERROR, \
|
||||
PTW32_SERVICES_FACILITY, \
|
||||
PTW32_SERVICES_ERROR )
|
||||
|
||||
#define PTW32_SERVICES_FACILITY 0xBAD
|
||||
#define PTW32_SERVICES_ERROR 0xDEED
|
||||
|
||||
#endif /* __CLEANUP_SEH */
|
||||
|
||||
/*
|
||||
* Services available through EXCEPTION_PTW32_SERVICES
|
||||
* and also used [as parameters to ptw32_throw()] as
|
||||
* generic exception selectors.
|
||||
*/
|
||||
|
||||
#define PTW32_EPS_EXIT (1)
|
||||
#define PTW32_EPS_CANCEL (2)
|
||||
|
||||
|
||||
/* Useful macros */
|
||||
#define PTW32_MAX(a,b) ((a)<(b)?(b):(a))
|
||||
#define PTW32_MIN(a,b) ((a)>(b)?(b):(a))
|
||||
|
||||
|
||||
/* Declared in pthread_cancel.c */
|
||||
extern DWORD (*ptw32_register_cancelation) (PAPCFUNC, HANDLE, DWORD);
|
||||
|
||||
/* Thread Reuse stack bottom marker. Must not be NULL or any valid pointer to memory. */
|
||||
#define PTW32_THREAD_REUSE_EMPTY ((ptw32_thread_t *)(size_t) 1)
|
||||
|
||||
extern int ptw32_processInitialized;
|
||||
extern ptw32_thread_t * ptw32_threadReuseTop;
|
||||
extern ptw32_thread_t * ptw32_threadReuseBottom;
|
||||
extern pthread_key_t ptw32_selfThreadKey;
|
||||
extern pthread_key_t ptw32_cleanupKey;
|
||||
extern pthread_cond_t ptw32_cond_list_head;
|
||||
extern pthread_cond_t ptw32_cond_list_tail;
|
||||
|
||||
extern int ptw32_mutex_default_kind;
|
||||
|
||||
extern unsigned __int64 ptw32_threadSeqNumber;
|
||||
|
||||
extern int ptw32_concurrency;
|
||||
|
||||
extern int ptw32_features;
|
||||
|
||||
extern ptw32_mcs_lock_t ptw32_thread_reuse_lock;
|
||||
extern ptw32_mcs_lock_t ptw32_mutex_test_init_lock;
|
||||
extern ptw32_mcs_lock_t ptw32_cond_list_lock;
|
||||
extern ptw32_mcs_lock_t ptw32_cond_test_init_lock;
|
||||
extern ptw32_mcs_lock_t ptw32_rwlock_test_init_lock;
|
||||
extern ptw32_mcs_lock_t ptw32_spinlock_test_init_lock;
|
||||
|
||||
#if defined(_UWIN)
|
||||
extern int pthread_count;
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* =====================
|
||||
* =====================
|
||||
* Forward Declarations
|
||||
* =====================
|
||||
* =====================
|
||||
*/
|
||||
|
||||
int ptw32_is_attr (const pthread_attr_t * attr);
|
||||
|
||||
int ptw32_cond_check_need_init (pthread_cond_t * cond);
|
||||
int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
|
||||
int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
|
||||
|
||||
int ptw32_robust_mutex_inherit(pthread_mutex_t * mutex);
|
||||
void ptw32_robust_mutex_add(pthread_mutex_t* mutex, pthread_t self);
|
||||
void ptw32_robust_mutex_remove(pthread_mutex_t* mutex, ptw32_thread_t* otp);
|
||||
|
||||
DWORD
|
||||
ptw32_RegisterCancelation (PAPCFUNC callback,
|
||||
HANDLE threadH, DWORD callback_arg);
|
||||
|
||||
int ptw32_processInitialize (void);
|
||||
|
||||
void ptw32_processTerminate (void);
|
||||
|
||||
void ptw32_threadDestroy (pthread_t tid);
|
||||
|
||||
void ptw32_pop_cleanup_all (int execute);
|
||||
|
||||
pthread_t ptw32_new (void);
|
||||
|
||||
pthread_t ptw32_threadReusePop (void);
|
||||
|
||||
void ptw32_threadReusePush (pthread_t thread);
|
||||
|
||||
int ptw32_getprocessors (int *count);
|
||||
|
||||
int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
|
||||
|
||||
void ptw32_rwlock_cancelwrwait (void *arg);
|
||||
|
||||
#if ! (defined (__MINGW64__) || defined(__MINGW32__)) || (defined(__MSVCRT__) && ! defined(__DMC__))
|
||||
unsigned __stdcall
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
ptw32_threadStart (void *vthreadParms);
|
||||
|
||||
void ptw32_callUserDestroyRoutines (pthread_t thread);
|
||||
|
||||
int ptw32_tkAssocCreate (ptw32_thread_t * thread, pthread_key_t key);
|
||||
|
||||
void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
|
||||
|
||||
int ptw32_semwait (sem_t * sem);
|
||||
|
||||
DWORD ptw32_relmillisecs (const struct timespec * abstime);
|
||||
|
||||
void ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node);
|
||||
|
||||
int ptw32_mcs_lock_try_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node);
|
||||
|
||||
void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node);
|
||||
|
||||
void ptw32_mcs_node_transfer (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node_t * old_node);
|
||||
|
||||
#if defined(NEED_FTIME)
|
||||
void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft);
|
||||
void ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts);
|
||||
#endif
|
||||
|
||||
/* Declared in misc.c */
|
||||
#if defined(NEED_CALLOC)
|
||||
#define calloc(n, s) ptw32_calloc(n, s)
|
||||
void *ptw32_calloc (size_t n, size_t s);
|
||||
#endif
|
||||
|
||||
/* Declared in private.c */
|
||||
#if defined(_MSC_VER)
|
||||
/*
|
||||
* Ignore the warning:
|
||||
* "C++ exception specification ignored except to indicate that
|
||||
* the function is not __declspec(nothrow)."
|
||||
*/
|
||||
#pragma warning(disable:4290)
|
||||
#endif
|
||||
void ptw32_throw (DWORD exception)
|
||||
#if defined(__CLEANUP_CXX)
|
||||
throw(ptw32_exception_cancel,ptw32_exception_exit)
|
||||
#endif
|
||||
;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#if defined(_UWIN_)
|
||||
# if defined(_MT)
|
||||
# if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
# endif
|
||||
_CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
|
||||
unsigned, void *);
|
||||
_CRTIMP void __cdecl _endthread (void);
|
||||
_CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
|
||||
unsigned (__stdcall *) (void *),
|
||||
void *, unsigned, unsigned *);
|
||||
_CRTIMP void __cdecl _endthreadex (unsigned);
|
||||
# if defined(__cplusplus)
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# include <process.h>
|
||||
# endif
|
||||
|
||||
|
||||
/*
|
||||
* Use intrinsic versions wherever possible. VC will do this
|
||||
* automatically where possible and GCC define these if available:
|
||||
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
|
||||
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
|
||||
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
|
||||
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
|
||||
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
|
||||
*
|
||||
* The full set of Interlocked intrinsics in GCC are (check versions):
|
||||
* type __sync_fetch_and_add (type *ptr, type value, ...)
|
||||
* type __sync_fetch_and_sub (type *ptr, type value, ...)
|
||||
* type __sync_fetch_and_or (type *ptr, type value, ...)
|
||||
* type __sync_fetch_and_and (type *ptr, type value, ...)
|
||||
* type __sync_fetch_and_xor (type *ptr, type value, ...)
|
||||
* type __sync_fetch_and_nand (type *ptr, type value, ...)
|
||||
* type __sync_add_and_fetch (type *ptr, type value, ...)
|
||||
* type __sync_sub_and_fetch (type *ptr, type value, ...)
|
||||
* type __sync_or_and_fetch (type *ptr, type value, ...)
|
||||
* type __sync_and_and_fetch (type *ptr, type value, ...)
|
||||
* type __sync_xor_and_fetch (type *ptr, type value, ...)
|
||||
* type __sync_nand_and_fetch (type *ptr, type value, ...)
|
||||
* bool __sync_bool_compare_and_swap (type *ptr, type oldval type newval, ...)
|
||||
* type __sync_val_compare_and_swap (type *ptr, type oldval type newval, ...)
|
||||
* __sync_synchronize (...) // Full memory barrier
|
||||
* type __sync_lock_test_and_set (type *ptr, type value, ...) // Acquire barrier
|
||||
* void __sync_lock_release (type *ptr, ...) // Release barrier
|
||||
*
|
||||
* These are all overloaded and take 1,2,4,8 byte scalar or pointer types.
|
||||
*
|
||||
* The above aren't available in Mingw32 as of gcc 4.5.2 so define our own.
|
||||
*/
|
||||
#if defined(__GNUC__)
|
||||
# if defined(_WIN64)
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_64(location, value, comparand) \
|
||||
({ \
|
||||
__typeof (value) _result; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"cmpxchgq %2,(%1)" \
|
||||
:"=a" (_result) \
|
||||
:"r" (location), "r" (value), "a" (comparand) \
|
||||
:"memory", "cc"); \
|
||||
_result; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_64(location, value) \
|
||||
({ \
|
||||
__typeof (value) _result; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"xchgq %0,(%1)" \
|
||||
:"=r" (_result) \
|
||||
:"r" (location), "0" (value) \
|
||||
:"memory", "cc"); \
|
||||
_result; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_ADD_64(location, value) \
|
||||
({ \
|
||||
__typeof (value) _result; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"xaddq %0,(%1)" \
|
||||
:"=r" (_result) \
|
||||
:"r" (location), "0" (value) \
|
||||
:"memory", "cc"); \
|
||||
_result; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_INCREMENT_64(location) \
|
||||
({ \
|
||||
PTW32_INTERLOCKED_LONG _temp = 1; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"xaddq %0,(%1)" \
|
||||
:"+r" (_temp) \
|
||||
:"r" (location) \
|
||||
:"memory", "cc"); \
|
||||
++_temp; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_DECREMENT_64(location) \
|
||||
({ \
|
||||
PTW32_INTERLOCKED_LONG _temp = -1; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"xaddq %2,(%1)" \
|
||||
:"+r" (_temp) \
|
||||
:"r" (location) \
|
||||
:"memory", "cc"); \
|
||||
--_temp; \
|
||||
})
|
||||
#endif
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG(location, value, comparand) \
|
||||
({ \
|
||||
__typeof (value) _result; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"cmpxchgl %2,(%1)" \
|
||||
:"=a" (_result) \
|
||||
:"r" (location), "r" (value), "a" (comparand) \
|
||||
:"memory", "cc"); \
|
||||
_result; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_LONG(location, value) \
|
||||
({ \
|
||||
__typeof (value) _result; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"xchgl %0,(%1)" \
|
||||
:"=r" (_result) \
|
||||
:"r" (location), "0" (value) \
|
||||
:"memory", "cc"); \
|
||||
_result; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_ADD_LONG(location, value) \
|
||||
({ \
|
||||
__typeof (value) _result; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"xaddl %0,(%1)" \
|
||||
:"=r" (_result) \
|
||||
:"r" (location), "0" (value) \
|
||||
:"memory", "cc"); \
|
||||
_result; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_INCREMENT_LONG(location) \
|
||||
({ \
|
||||
PTW32_INTERLOCKED_LONG _temp = 1; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"xaddl %0,(%1)" \
|
||||
:"+r" (_temp) \
|
||||
:"r" (location) \
|
||||
:"memory", "cc"); \
|
||||
++_temp; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_DECREMENT_LONG(location) \
|
||||
({ \
|
||||
PTW32_INTERLOCKED_LONG _temp = -1; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"lock\n\t" \
|
||||
"xaddl %0,(%1)" \
|
||||
:"+r" (_temp) \
|
||||
:"r" (location) \
|
||||
:"memory", "cc"); \
|
||||
--_temp; \
|
||||
})
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR(location, value, comparand) \
|
||||
PTW32_INTERLOCKED_COMPARE_EXCHANGE_SIZE((PTW32_INTERLOCKED_SIZEPTR)location, \
|
||||
(PTW32_INTERLOCKED_SIZE)value, \
|
||||
(PTW32_INTERLOCKED_SIZE)comparand)
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_PTR(location, value) \
|
||||
PTW32_INTERLOCKED_EXCHANGE_SIZE((PTW32_INTERLOCKED_SIZEPTR)location, \
|
||||
(PTW32_INTERLOCKED_SIZE)value)
|
||||
#else
|
||||
# if defined(_WIN64)
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_64 InterlockedCompareExchange64
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_64 InterlockedExchange64
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_ADD_64 InterlockedExchangeAdd64
|
||||
# define PTW32_INTERLOCKED_INCREMENT_64 InterlockedIncrement64
|
||||
# define PTW32_INTERLOCKED_DECREMENT_64 InterlockedDecrement64
|
||||
# endif
|
||||
# if defined(_MSC_VER) && _MSC_VER < 1300 && !defined(_WIN64) /* MSVC 6 */
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG(location, value, comparand) \
|
||||
((LONG)InterlockedCompareExchange((PVOID *)(location), (PVOID)(value), (PVOID)(comparand)))
|
||||
# else
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG InterlockedCompareExchange
|
||||
# endif
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_LONG InterlockedExchange
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_ADD_LONG InterlockedExchangeAdd
|
||||
# define PTW32_INTERLOCKED_INCREMENT_LONG InterlockedIncrement
|
||||
# define PTW32_INTERLOCKED_DECREMENT_LONG InterlockedDecrement
|
||||
# if defined(_MSC_VER) && _MSC_VER < 1300 && !defined(_WIN64) /* MSVC 6 */
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR InterlockedCompareExchange
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_PTR(location, value) \
|
||||
((PVOID)InterlockedExchange((LPLONG)(location), (LONG)(value)))
|
||||
# else
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR InterlockedCompareExchangePointer
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_PTR InterlockedExchangePointer
|
||||
# endif
|
||||
#endif
|
||||
#if defined(_WIN64)
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_SIZE PTW32_INTERLOCKED_COMPARE_EXCHANGE_64
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_SIZE PTW32_INTERLOCKED_EXCHANGE_64
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_ADD_SIZE PTW32_INTERLOCKED_EXCHANGE_ADD_64
|
||||
# define PTW32_INTERLOCKED_INCREMENT_SIZE PTW32_INTERLOCKED_INCREMENT_64
|
||||
# define PTW32_INTERLOCKED_DECREMENT_SIZE PTW32_INTERLOCKED_DECREMENT_64
|
||||
#else
|
||||
# define PTW32_INTERLOCKED_COMPARE_EXCHANGE_SIZE PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_SIZE PTW32_INTERLOCKED_EXCHANGE_LONG
|
||||
# define PTW32_INTERLOCKED_EXCHANGE_ADD_SIZE PTW32_INTERLOCKED_EXCHANGE_ADD_LONG
|
||||
# define PTW32_INTERLOCKED_INCREMENT_SIZE PTW32_INTERLOCKED_INCREMENT_LONG
|
||||
# define PTW32_INTERLOCKED_DECREMENT_SIZE PTW32_INTERLOCKED_DECREMENT_LONG
|
||||
#endif
|
||||
|
||||
#if defined(NEED_CREATETHREAD)
|
||||
|
||||
/*
|
||||
* Macro uses args so we can cast start_proc to LPTHREAD_START_ROUTINE
|
||||
* in order to avoid warnings because of return type
|
||||
*/
|
||||
|
||||
#define _beginthreadex(security, \
|
||||
stack_size, \
|
||||
start_proc, \
|
||||
arg, \
|
||||
flags, \
|
||||
pid) \
|
||||
CreateThread(security, \
|
||||
stack_size, \
|
||||
(LPTHREAD_START_ROUTINE) start_proc, \
|
||||
arg, \
|
||||
flags, \
|
||||
pid)
|
||||
|
||||
#define _endthreadex ExitThread
|
||||
|
||||
#endif /* NEED_CREATETHREAD */
|
||||
|
||||
|
||||
#endif /* _IMPLEMENT_H */
|
|
@ -5,25 +5,25 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
|
@ -37,10 +37,8 @@
|
|||
* See the README file for an explanation of the pthreads-win32 version
|
||||
* numbering scheme and how the DLL is named etc.
|
||||
*/
|
||||
#define PTW32_VERSION 2,8,0,4
|
||||
#define PTW32_VERSION_STRING "2, 8, 0, 4\0"
|
||||
|
||||
#define PTW32_ALLOW_COND
|
||||
#define PTW32_VERSION 2,9,1,0
|
||||
#define PTW32_VERSION_STRING "2, 9, 1, 0\0"
|
||||
|
||||
/* There are three implementations of cancel cleanup.
|
||||
* Note that pthread.h is included in both application
|
||||
|
@ -67,7 +65,7 @@
|
|||
* Define defaults for cleanup code.
|
||||
* Note: Unless the build explicitly defines one of the following, then
|
||||
* we default to standard C style cleanup. This style uses setjmp/longjmp
|
||||
* in the cancellation and thread exit implementations and therefore won't
|
||||
* in the cancelation and thread exit implementations and therefore won't
|
||||
* do stack unwinding if linked to applications that have it (e.g.
|
||||
* C++ apps). This is currently consistent with most/all commercial Unix
|
||||
* POSIX threads implementations.
|
||||
|
@ -83,7 +81,7 @@
|
|||
/*
|
||||
* Stop here if we are being included by the resource compiler.
|
||||
*/
|
||||
#ifndef RC_INVOKED
|
||||
#if !defined(RC_INVOKED)
|
||||
|
||||
#undef PTW32_LEVEL
|
||||
|
||||
|
@ -106,15 +104,15 @@
|
|||
|
||||
#define PTW32_LEVEL_MAX 3
|
||||
|
||||
#if !defined(PTW32_LEVEL)
|
||||
#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_LEVEL)
|
||||
#define PTW32_LEVEL PTW32_LEVEL_MAX
|
||||
/* Include everything */
|
||||
#endif
|
||||
|
||||
#ifdef _UWIN
|
||||
#if defined(_UWIN)
|
||||
# define HAVE_STRUCT_TIMESPEC 1
|
||||
# define HAVE_SIGNAL_H 1
|
||||
# undef HAVE_CONFIG_H
|
||||
# undef HAVE_PTW32_CONFIG_H
|
||||
# pragma comment(lib, "pthread")
|
||||
#endif
|
||||
|
||||
|
@ -196,11 +194,11 @@
|
|||
*/
|
||||
|
||||
/* Try to avoid including windows.h */
|
||||
#if defined(__MINGW32__) && defined(__cplusplus)
|
||||
#if (defined(__MINGW64__) || defined(__MINGW32__)) && defined(__cplusplus)
|
||||
#define PTW32_INCLUDE_WINDOWS_H
|
||||
#endif
|
||||
|
||||
#ifdef PTW32_INCLUDE_WINDOWS_H
|
||||
#if defined(PTW32_INCLUDE_WINDOWS_H)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -209,6 +207,7 @@
|
|||
* VC++6.0 or early compiler's header has no DWORD_PTR type.
|
||||
*/
|
||||
typedef unsigned long DWORD_PTR;
|
||||
typedef unsigned long ULONG_PTR;
|
||||
#endif
|
||||
/*
|
||||
* -----------------
|
||||
|
@ -216,23 +215,20 @@ typedef unsigned long DWORD_PTR;
|
|||
* -----------------
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#if defined(HAVE_PTW32_CONFIG_H)
|
||||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
#endif /* HAVE_PTW32_CONFIG_H */
|
||||
|
||||
#ifndef NEED_FTIME
|
||||
#if !defined(NEED_FTIME)
|
||||
#include <time.h>
|
||||
#else /* NEED_FTIME */
|
||||
/* use native WIN32 time API */
|
||||
#endif /* NEED_FTIME */
|
||||
|
||||
#if HAVE_SIGNAL_H
|
||||
#if defined(HAVE_SIGNAL_H)
|
||||
#include <signal.h>
|
||||
#endif /* HAVE_SIGNAL_H */
|
||||
|
||||
#ifdef __CLEANUP_C
|
||||
#include <setjmp.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
/*
|
||||
|
@ -248,12 +244,15 @@ enum {
|
|||
* which is only used when building the pthread-win32 libraries.
|
||||
*/
|
||||
|
||||
#ifndef PTW32_CONFIG_H
|
||||
#if !defined(PTW32_CONFIG_H)
|
||||
# if defined(WINCE)
|
||||
# define NEED_ERRNO
|
||||
# define NEED_SEM
|
||||
# endif
|
||||
# if defined(_UWIN) || defined(__MINGW32__)
|
||||
# if defined(__MINGW64__)
|
||||
# define HAVE_STRUCT_TIMESPEC
|
||||
# define HAVE_MODE_T
|
||||
# elif defined(_UWIN) || defined(__MINGW32__)
|
||||
# define HAVE_MODE_T
|
||||
# endif
|
||||
#endif
|
||||
|
@ -263,7 +262,7 @@ enum {
|
|||
*/
|
||||
|
||||
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
|
||||
#ifdef NEED_ERRNO
|
||||
#if defined(NEED_ERRNO)
|
||||
#include "need_errno.h"
|
||||
#else
|
||||
#include <errno.h>
|
||||
|
@ -273,65 +272,75 @@ enum {
|
|||
/*
|
||||
* Several systems don't define some error numbers.
|
||||
*/
|
||||
#ifndef ENOTSUP
|
||||
#if !defined(ENOTSUP)
|
||||
# define ENOTSUP 48 /* This is the value in Solaris. */
|
||||
#endif
|
||||
|
||||
#ifndef ETIMEDOUT
|
||||
# define ETIMEDOUT 10060 /* This is the value in winsock.h. */
|
||||
#if !defined(ETIMEDOUT)
|
||||
# define ETIMEDOUT 10060 /* Same as WSAETIMEDOUT */
|
||||
#endif
|
||||
|
||||
#ifndef ENOSYS
|
||||
#if !defined(ENOSYS)
|
||||
# define ENOSYS 140 /* Semi-arbitrary value */
|
||||
#endif
|
||||
|
||||
#ifndef EDEADLK
|
||||
# ifdef EDEADLOCK
|
||||
#if !defined(EDEADLK)
|
||||
# if defined(EDEADLOCK)
|
||||
# define EDEADLK EDEADLOCK
|
||||
# else
|
||||
# define EDEADLK 36 /* This is the value in MSVC. */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* POSIX 2008 - related to robust mutexes */
|
||||
#if !defined(EOWNERDEAD)
|
||||
# define EOWNERDEAD 43
|
||||
#endif
|
||||
#if !defined(ENOTRECOVERABLE)
|
||||
# define ENOTRECOVERABLE 44
|
||||
#endif
|
||||
|
||||
#include <sched.h>
|
||||
|
||||
/*
|
||||
* To avoid including windows.h we define only those things that we
|
||||
* actually need from it.
|
||||
*/
|
||||
#ifndef PTW32_INCLUDE_WINDOWS_H
|
||||
#ifndef HANDLE
|
||||
#if !defined(PTW32_INCLUDE_WINDOWS_H)
|
||||
#if !defined(HANDLE)
|
||||
# define PTW32__HANDLE_DEF
|
||||
# define HANDLE void *
|
||||
#endif
|
||||
#ifndef DWORD
|
||||
#if !defined(DWORD)
|
||||
# define PTW32__DWORD_DEF
|
||||
# define DWORD unsigned long
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined( HAVE_STRUCT_TIMESPEC ) && !defined( _TIMESPEC_DEFINED )
|
||||
#define HAVE_STRUCT_TIMESPEC 1
|
||||
#define _TIMESPEC_DEFINED 1
|
||||
#if !defined(HAVE_STRUCT_TIMESPEC)
|
||||
#define HAVE_STRUCT_TIMESPEC
|
||||
#if !defined(_TIMESPEC_DEFINED)
|
||||
#define _TIMESPEC_DEFINED
|
||||
struct timespec {
|
||||
long tv_sec;
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
#endif /* _TIMESPEC_DEFINED */
|
||||
#endif /* HAVE_STRUCT_TIMESPEC */
|
||||
|
||||
#ifndef SIG_BLOCK
|
||||
#if !defined(SIG_BLOCK)
|
||||
#define SIG_BLOCK 0
|
||||
#endif /* SIG_BLOCK */
|
||||
|
||||
#ifndef SIG_UNBLOCK
|
||||
#if !defined(SIG_UNBLOCK)
|
||||
#define SIG_UNBLOCK 1
|
||||
#endif /* SIG_UNBLOCK */
|
||||
|
||||
#ifndef SIG_SETMASK
|
||||
#if !defined(SIG_SETMASK)
|
||||
#define SIG_SETMASK 2
|
||||
#endif /* SIG_SETMASK */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
@ -427,22 +436,22 @@ extern "C"
|
|||
* POSIX Options
|
||||
*/
|
||||
#undef _POSIX_THREADS
|
||||
#define _POSIX_THREADS 200112L
|
||||
#define _POSIX_THREADS 200809L
|
||||
|
||||
#undef _POSIX_READER_WRITER_LOCKS
|
||||
#define _POSIX_READER_WRITER_LOCKS 200112L
|
||||
#define _POSIX_READER_WRITER_LOCKS 200809L
|
||||
|
||||
#undef _POSIX_SPIN_LOCKS
|
||||
#define _POSIX_SPIN_LOCKS 200112L
|
||||
#define _POSIX_SPIN_LOCKS 200809L
|
||||
|
||||
#undef _POSIX_BARRIERS
|
||||
#define _POSIX_BARRIERS 200112L
|
||||
#define _POSIX_BARRIERS 200809L
|
||||
|
||||
#undef _POSIX_THREAD_SAFE_FUNCTIONS
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
|
||||
|
||||
#undef _POSIX_THREAD_ATTR_STACKSIZE
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
|
||||
|
||||
/*
|
||||
* The following options are not supported
|
||||
|
@ -532,18 +541,18 @@ extern "C"
|
|||
#define SEM_VALUE_MAX INT_MAX
|
||||
|
||||
|
||||
#if __GNUC__ && ! defined (__declspec)
|
||||
#if defined(__GNUC__) && !defined(__declspec)
|
||||
# error Please upgrade your GNU compiler to one that supports __declspec.
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When building the DLL code, you should define PTW32_BUILD so that
|
||||
* the variables/functions are exported correctly. When using the DLL,
|
||||
* When building the library, you should define PTW32_BUILD so that
|
||||
* the variables/functions are exported correctly. When using the library,
|
||||
* do NOT define PTW32_BUILD, and then the variables/functions will
|
||||
* be imported correctly.
|
||||
*/
|
||||
#ifndef PTW32_STATIC_LIB
|
||||
# ifdef PTW32_BUILD
|
||||
#if !defined(PTW32_STATIC_LIB)
|
||||
# if defined(PTW32_BUILD)
|
||||
# define PTW32_DLLPORT __declspec (dllexport)
|
||||
# else
|
||||
# define PTW32_DLLPORT __declspec (dllimport)
|
||||
|
@ -572,19 +581,19 @@ extern "C"
|
|||
* that available with a simple pointer. It should scale for either
|
||||
* IA-32 or IA-64.
|
||||
*/
|
||||
typedef struct _ptw32_handle_t {
|
||||
typedef struct ptw32_handle_t {
|
||||
void * p; /* Pointer to actual object */
|
||||
unsigned int x; /* Extra information - reuse count etc */
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Added support for various operators so that the struct is
|
||||
// more pthreads-compliant in behavior. (air)
|
||||
const bool operator ==( const struct _ptw32_handle_t rightside ) const
|
||||
const bool operator ==( const struct ptw32_handle_t rightside ) const
|
||||
{
|
||||
return p == rightside.p;
|
||||
}
|
||||
|
||||
const bool operator !=( const struct _ptw32_handle_t rightside ) const
|
||||
const bool operator !=( const struct ptw32_handle_t rightside ) const
|
||||
{
|
||||
return p != rightside.p;
|
||||
}
|
||||
|
@ -653,6 +662,12 @@ enum {
|
|||
PTHREAD_PROCESS_PRIVATE = 0,
|
||||
PTHREAD_PROCESS_SHARED = 1,
|
||||
|
||||
/*
|
||||
* pthread_mutexattr_{get,set}robust
|
||||
*/
|
||||
PTHREAD_MUTEX_STALLED = 0, /* Default */
|
||||
PTHREAD_MUTEX_ROBUST = 1,
|
||||
|
||||
/*
|
||||
* pthread_barrier_wait
|
||||
*/
|
||||
|
@ -666,7 +681,7 @@ enum {
|
|||
* ====================
|
||||
* ====================
|
||||
*/
|
||||
#define PTHREAD_CANCELED ((void *) -1)
|
||||
#define PTHREAD_CANCELED ((void *)(size_t) -1)
|
||||
|
||||
|
||||
/*
|
||||
|
@ -694,13 +709,9 @@ struct pthread_once_t_
|
|||
* ====================
|
||||
* ====================
|
||||
*/
|
||||
|
||||
// Note: Static mutexes are useful in C but a bad idea in C++, and add overhead to all
|
||||
// mutex lockers (bad!), so C++ code should idisable them and use C++ initializers instead.
|
||||
|
||||
#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1)
|
||||
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER ((pthread_mutex_t) -2)
|
||||
#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ((pthread_mutex_t) -3)
|
||||
#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t)(size_t) -1)
|
||||
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER ((pthread_mutex_t)(size_t) -2)
|
||||
#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ((pthread_mutex_t)(size_t) -3)
|
||||
|
||||
/*
|
||||
* Compatibility with LinuxThreads
|
||||
|
@ -708,11 +719,11 @@ struct pthread_once_t_
|
|||
#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER
|
||||
#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
|
||||
|
||||
#define PTHREAD_COND_INITIALIZER ((pthread_cond_t) -1)
|
||||
#define PTHREAD_COND_INITIALIZER ((pthread_cond_t)(size_t) -1)
|
||||
|
||||
#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) -1)
|
||||
#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t)(size_t) -1)
|
||||
|
||||
#define PTHREAD_SPINLOCK_INITIALIZER ((pthread_spinlock_t) -1)
|
||||
#define PTHREAD_SPINLOCK_INITIALIZER ((pthread_spinlock_t)(size_t) -1)
|
||||
|
||||
|
||||
/*
|
||||
|
@ -754,9 +765,7 @@ struct ptw32_cleanup_t
|
|||
struct ptw32_cleanup_t *prev;
|
||||
};
|
||||
|
||||
#ifdef __CLEANUP_SEH
|
||||
#include <excpt.h> // PCSX2: excpt.h is needed for AbnormalTermination() -- air
|
||||
|
||||
#if defined(__CLEANUP_SEH)
|
||||
/*
|
||||
* WIN32 SEH version of cancel cleanup.
|
||||
*/
|
||||
|
@ -783,7 +792,7 @@ struct ptw32_cleanup_t
|
|||
|
||||
#else /* __CLEANUP_SEH */
|
||||
|
||||
#ifdef __CLEANUP_C
|
||||
#if defined(__CLEANUP_C)
|
||||
|
||||
/*
|
||||
* C implementation of PThreads cancel cleanup
|
||||
|
@ -801,7 +810,7 @@ struct ptw32_cleanup_t
|
|||
|
||||
#else /* __CLEANUP_C */
|
||||
|
||||
#ifdef __CLEANUP_CXX
|
||||
#if defined(__CLEANUP_CXX)
|
||||
|
||||
/*
|
||||
* C++ version of cancel cleanup.
|
||||
|
@ -929,13 +938,13 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr,
|
|||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *,
|
||||
int);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (pthread_attr_t *,
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (const pthread_attr_t *,
|
||||
int *);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setinheritsched(pthread_attr_t * attr,
|
||||
int inheritsched);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(pthread_attr_t * attr,
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(const pthread_attr_t * attr,
|
||||
int * inheritsched);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setscope (pthread_attr_t *,
|
||||
|
@ -949,7 +958,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *,
|
|||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid,
|
||||
const pthread_attr_t * attr,
|
||||
void *(*start) (void *),
|
||||
void *(PTW32_CDECL *start) (void *),
|
||||
void *arg);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid);
|
||||
|
@ -964,7 +973,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_join (pthread_t thread,
|
|||
|
||||
PTW32_DLLPORT pthread_t PTW32_CDECL pthread_self (void);
|
||||
|
||||
extern int pthread_cancel (pthread_t thread);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cancel (pthread_t thread);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state,
|
||||
int *oldstate);
|
||||
|
@ -972,16 +981,16 @@ PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state,
|
|||
PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type,
|
||||
int *oldtype);
|
||||
|
||||
extern void pthread_testcancel (void);
|
||||
PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control,
|
||||
void (*init_routine) (void));
|
||||
void (PTW32_CDECL *init_routine) (void));
|
||||
|
||||
#if PTW32_LEVEL >= PTW32_LEVEL_MAX && defined(__CLEANUP_C)
|
||||
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
|
||||
PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
|
||||
void (*routine) (void *),
|
||||
ptw32_cleanup_callback_t routine,
|
||||
void *arg);
|
||||
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
|
||||
|
||||
|
@ -989,7 +998,7 @@ PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
|
|||
* Thread Specific Data Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key,
|
||||
void (*destructor) (void *));
|
||||
void (PTW32_CDECL *destructor) (void *));
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key);
|
||||
|
||||
|
@ -1014,7 +1023,14 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t
|
|||
int pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (pthread_mutexattr_t * attr, int *kind);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (const pthread_mutexattr_t * attr, int *kind);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setrobust(
|
||||
pthread_mutexattr_t *attr,
|
||||
int robust);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getrobust(
|
||||
const pthread_mutexattr_t * attr,
|
||||
int * robust);
|
||||
|
||||
/*
|
||||
* Barrier Attribute Functions
|
||||
|
@ -1038,22 +1054,19 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex,
|
|||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex);
|
||||
|
||||
extern int pthread_mutex_lock (pthread_mutex_t * mutex);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_lock (pthread_mutex_t * mutex);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_timedlock(pthread_mutex_t *mutex,
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_timedlock(pthread_mutex_t * mutex,
|
||||
const struct timespec *abstime);
|
||||
|
||||
extern int pthread_mutex_trylock (pthread_mutex_t * mutex);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex);
|
||||
|
||||
extern int pthread_mutex_unlock (pthread_mutex_t * mutex);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_unlock (pthread_mutex_t * mutex);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_consistent (pthread_mutex_t * mutex);
|
||||
|
||||
#ifdef PTW32_ALLOW_SPIN
|
||||
/*
|
||||
* Spinlock Functions
|
||||
*
|
||||
* These are disabled by default; they are not part of the "required" portion of pthreads
|
||||
* implementations, and they are generally a bad idea for anything except the most controlled
|
||||
* of threaded environments (which hardly exist in modern computing).
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_init (pthread_spinlock_t * lock, int pshared);
|
||||
|
||||
|
@ -1064,7 +1077,6 @@ PTW32_DLLPORT int PTW32_CDECL pthread_spin_lock (pthread_spinlock_t * lock);
|
|||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_trylock (pthread_spinlock_t * lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Barrier Functions
|
||||
|
@ -1077,7 +1089,6 @@ PTW32_DLLPORT int PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barri
|
|||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_wait (pthread_barrier_t * barrier);
|
||||
|
||||
#ifdef PTW32_ALLOW_COND
|
||||
/*
|
||||
* Condition Variable Attribute Functions
|
||||
*/
|
||||
|
@ -1109,7 +1120,6 @@ PTW32_DLLPORT int PTW32_CDECL pthread_cond_timedwait (pthread_cond_t * cond,
|
|||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_signal (pthread_cond_t * cond);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_broadcast (pthread_cond_t * cond);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Scheduling
|
||||
|
@ -1123,7 +1133,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_getschedparam (pthread_t thread,
|
|||
struct sched_param *param);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setconcurrency (int);
|
||||
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_getconcurrency (void);
|
||||
|
||||
/*
|
||||
|
@ -1185,6 +1195,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t *
|
|||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_num_processors_np(void);
|
||||
PTW32_DLLPORT unsigned __int64 PTW32_CDECL pthread_getunique_np(pthread_t thread);
|
||||
|
||||
/*
|
||||
* Useful if an application wants to statically link
|
||||
|
@ -1222,6 +1233,10 @@ PTW32_DLLPORT void * PTW32_CDECL pthread_timechange_handler_np(void *);
|
|||
* Returns the Win32 HANDLE for the POSIX thread.
|
||||
*/
|
||||
PTW32_DLLPORT HANDLE PTW32_CDECL pthread_getw32threadhandle_np(pthread_t thread);
|
||||
/*
|
||||
* Returns the win32 thread ID for POSIX thread.
|
||||
*/
|
||||
PTW32_DLLPORT DWORD PTW32_CDECL pthread_getw32threadid_np (pthread_t thread);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1248,11 +1263,11 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
|
|||
/*
|
||||
* Thread-Safe C Runtime Library Mappings.
|
||||
*/
|
||||
#ifndef _UWIN
|
||||
#if !defined(_UWIN)
|
||||
# if defined(NEED_ERRNO)
|
||||
PTW32_DLLPORT int * PTW32_CDECL _errno( void );
|
||||
# else
|
||||
# ifndef errno
|
||||
# if !defined(errno)
|
||||
# if (defined(_MT) || defined(_DLL))
|
||||
__declspec(dllimport) extern int * __cdecl _errno(void);
|
||||
# define errno (*_errno())
|
||||
|
@ -1261,40 +1276,6 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WIN32 C runtime library had been made thread-safe
|
||||
* without affecting the user interface. Provide
|
||||
* mappings from the UNIX thread-safe versions to
|
||||
* the standard C runtime library calls.
|
||||
* Only provide function mappings for functions that
|
||||
* actually exist on WIN32.
|
||||
*/
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#define strtok_r( _s, _sep, _lasts ) \
|
||||
( *(_lasts) = strtok( (_s), (_sep) ) )
|
||||
#endif /* !__MINGW32__ */
|
||||
|
||||
#define asctime_r( _tm, _buf ) \
|
||||
( strcpy( (_buf), asctime( (_tm) ) ), \
|
||||
(_buf) )
|
||||
|
||||
#define ctime_r( _clock, _buf ) \
|
||||
( strcpy( (_buf), ctime( (_clock) ) ), \
|
||||
(_buf) )
|
||||
|
||||
#define gmtime_r( _clock, _result ) \
|
||||
( *(_result) = *gmtime( (_clock) ), \
|
||||
(_result) )
|
||||
|
||||
#define localtime_r( _clock, _result ) \
|
||||
( *(_result) = *localtime( (_clock) ), \
|
||||
(_result) )
|
||||
|
||||
#define rand_r( _seed ) \
|
||||
( _seed == _seed? rand() : rand() )
|
||||
|
||||
|
||||
/*
|
||||
* Some compiler environments don't define some things.
|
||||
*/
|
||||
|
@ -1303,7 +1284,7 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,
|
|||
# define _timeb timeb
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
|
||||
/*
|
||||
* Internal exceptions
|
||||
|
@ -1324,38 +1305,33 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
|
|||
|
||||
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
|
||||
|
||||
#ifndef PTW32_BUILD
|
||||
#if !defined(PTW32_BUILD)
|
||||
|
||||
#ifdef __CLEANUP_SEH
|
||||
#if defined(__CLEANUP_SEH)
|
||||
|
||||
/*
|
||||
* Redefine the SEH __except keyword to ensure that applications
|
||||
* propagate our internal exceptions up to the library's internal handlers.
|
||||
*/
|
||||
|
||||
// PCSX2: Holy crap, what?! No. Let's not force code conformity on stupid coders. If they can't write
|
||||
// a proper exception handler that does EXCEPTION_CONTINUE_SEARCH on unhandled exceptions, they deserve
|
||||
// whatever bad karma befalls them. --air
|
||||
|
||||
//#define __except( E ) \
|
||||
// __except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \
|
||||
// ? EXCEPTION_CONTINUE_SEARCH : ( E ) )
|
||||
#define __except( E ) \
|
||||
__except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \
|
||||
? EXCEPTION_CONTINUE_SEARCH : ( E ) )
|
||||
|
||||
#endif /* __CLEANUP_SEH */
|
||||
|
||||
#ifdef __CLEANUP_CXX
|
||||
#if defined(__CLEANUP_CXX)
|
||||
|
||||
/*
|
||||
* Redefine the C++ catch keyword to ensure that applications
|
||||
* propagate our internal exceptions up to the library's internal handlers.
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER)
|
||||
/*
|
||||
* WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll'
|
||||
* if you want Pthread-Win32 cancelation and pthread_exit to work.
|
||||
*/
|
||||
|
||||
#ifndef PtW32NoCatchWarn
|
||||
#if !defined(PtW32NoCatchWarn)
|
||||
|
||||
#pragma message("Specify \"/DPtW32NoCatchWarn\" compiler flag to skip this message.")
|
||||
#pragma message("------------------------------------------------------------------")
|
||||
|
@ -1364,7 +1340,7 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
|
|||
#pragma message(" with 'PtW32CatchAll' or 'CATCHALL' if you want POSIX thread")
|
||||
#pragma message(" cancelation and pthread_exit to work. For example:")
|
||||
#pragma message("")
|
||||
#pragma message(" #ifdef PtW32CatchAll")
|
||||
#pragma message(" #if defined(PtW32CatchAll)")
|
||||
#pragma message(" PtW32CatchAll")
|
||||
#pragma message(" #else")
|
||||
#pragma message(" catch(...)")
|
||||
|
@ -1392,14 +1368,14 @@ PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void);
|
|||
|
||||
#endif /* ! PTW32_BUILD */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
} /* End of extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef PTW32__HANDLE_DEF
|
||||
#if defined(PTW32__HANDLE_DEF)
|
||||
# undef HANDLE
|
||||
#endif
|
||||
#ifdef PTW32__DWORD_DEF
|
||||
#if defined(PTW32__DWORD_DEF)
|
||||
# undef DWORD
|
||||
#endif
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Purpose:
|
||||
* Provides an implementation of POSIX realtime extensions
|
||||
* as defined in
|
||||
* as defined in
|
||||
*
|
||||
* POSIX 1003.1b-1993 (POSIX.1b)
|
||||
*
|
||||
|
@ -12,72 +12,72 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifndef _SCHED_H
|
||||
#if !defined(_SCHED_H)
|
||||
#define _SCHED_H
|
||||
|
||||
#undef PTW32_LEVEL
|
||||
#undef PTW32_SCHED_LEVEL
|
||||
|
||||
#if defined(_POSIX_SOURCE)
|
||||
#define PTW32_LEVEL 0
|
||||
#define PTW32_SCHED_LEVEL 0
|
||||
/* Early POSIX */
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
|
||||
#undef PTW32_LEVEL
|
||||
#define PTW32_LEVEL 1
|
||||
#undef PTW32_SCHED_LEVEL
|
||||
#define PTW32_SCHED_LEVEL 1
|
||||
/* Include 1b, 1c and 1d */
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_NP)
|
||||
#undef PTW32_LEVEL
|
||||
#define PTW32_LEVEL 2
|
||||
#undef PTW32_SCHED_LEVEL
|
||||
#define PTW32_SCHED_LEVEL 2
|
||||
/* Include Non-Portable extensions */
|
||||
#endif
|
||||
|
||||
#define PTW32_LEVEL_MAX 3
|
||||
#define PTW32_SCHED_LEVEL_MAX 3
|
||||
|
||||
#if !defined(PTW32_LEVEL)
|
||||
#define PTW32_LEVEL PTW32_LEVEL_MAX
|
||||
#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_SCHED_LEVEL)
|
||||
#define PTW32_SCHED_LEVEL PTW32_SCHED_LEVEL_MAX
|
||||
/* Include everything */
|
||||
#endif
|
||||
|
||||
|
||||
#if __GNUC__ && ! defined (__declspec)
|
||||
#if defined(__GNUC__) && !defined(__declspec)
|
||||
# error Please upgrade your GNU compiler to one that supports __declspec.
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When building the DLL code, you should define PTW32_BUILD so that
|
||||
* the variables/functions are exported correctly. When using the DLL,
|
||||
* When building the library, you should define PTW32_BUILD so that
|
||||
* the variables/functions are exported correctly. When using the library,
|
||||
* do NOT define PTW32_BUILD, and then the variables/functions will
|
||||
* be imported correctly.
|
||||
*/
|
||||
#ifndef PTW32_STATIC_LIB
|
||||
# ifdef PTW32_BUILD
|
||||
#if !defined(PTW32_STATIC_LIB)
|
||||
# if defined(PTW32_BUILD)
|
||||
# define PTW32_DLLPORT __declspec (dllexport)
|
||||
# else
|
||||
# define PTW32_DLLPORT __declspec (dllimport)
|
||||
|
@ -91,12 +91,15 @@
|
|||
* which is only used when building the pthread-win32 libraries.
|
||||
*/
|
||||
|
||||
#ifndef PTW32_CONFIG_H
|
||||
#if !defined(PTW32_CONFIG_H)
|
||||
# if defined(WINCE)
|
||||
# define NEED_ERRNO
|
||||
# define NEED_SEM
|
||||
# endif
|
||||
# if defined(_UWIN) || defined(__MINGW32__)
|
||||
# if defined(__MINGW64__)
|
||||
# define HAVE_STRUCT_TIMESPEC
|
||||
# define HAVE_MODE_T
|
||||
# elif defined(_UWIN) || defined(__MINGW32__)
|
||||
# define HAVE_MODE_T
|
||||
# endif
|
||||
#endif
|
||||
|
@ -105,23 +108,25 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
|
||||
#ifdef NEED_ERRNO
|
||||
#if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX
|
||||
#if defined(NEED_ERRNO)
|
||||
#include "need_errno.h"
|
||||
#else
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
|
||||
#endif /* PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX */
|
||||
|
||||
#if defined(__MINGW32__) || defined(_UWIN)
|
||||
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
|
||||
#if (defined(__MINGW64__) || defined(__MINGW32__)) || defined(_UWIN)
|
||||
# if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX
|
||||
/* For pid_t */
|
||||
# include <sys/types.h>
|
||||
/* Required by Unix 98 */
|
||||
# include <time.h>
|
||||
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
|
||||
# else
|
||||
typedef int pid_t;
|
||||
# endif
|
||||
#else
|
||||
typedef int pid_t;
|
||||
typedef int pid_t;
|
||||
#endif
|
||||
|
||||
/* Thread scheduling policies */
|
||||
|
@ -138,7 +143,7 @@ struct sched_param {
|
|||
int sched_priority;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
@ -167,12 +172,12 @@ PTW32_DLLPORT int __cdecl sched_getscheduler (pid_t pid);
|
|||
( errno = ENOTSUP, (int) -1 )
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
} /* End of extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#undef PTW32_LEVEL
|
||||
#undef PTW32_LEVEL_MAX
|
||||
#undef PTW32_SCHED_LEVEL
|
||||
#undef PTW32_SCHED_LEVEL_MAX
|
||||
|
||||
#endif /* !_SCHED_H */
|
||||
|
|
@ -12,25 +12,25 @@
|
|||
* Pthreads-win32 - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999,2005 Pthreads-win32 contributors
|
||||
*
|
||||
*
|
||||
* Contact Email: rpj@callisto.canberra.edu.au
|
||||
*
|
||||
*
|
||||
* The current list of contributors is contained
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
* http://sources.redhat.com/pthreads-win32/contributors.html
|
||||
*
|
||||
*
|
||||
* This 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 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This 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 this library in the file COPYING.LIB;
|
||||
* if not, write to the Free Software Foundation, Inc.,
|
||||
|
@ -39,44 +39,44 @@
|
|||
#if !defined( SEMAPHORE_H )
|
||||
#define SEMAPHORE_H
|
||||
|
||||
#undef PTW32_LEVEL
|
||||
#undef PTW32_SEMAPHORE_LEVEL
|
||||
|
||||
#if defined(_POSIX_SOURCE)
|
||||
#define PTW32_LEVEL 0
|
||||
#define PTW32_SEMAPHORE_LEVEL 0
|
||||
/* Early POSIX */
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
|
||||
#undef PTW32_LEVEL
|
||||
#define PTW32_LEVEL 1
|
||||
#undef PTW32_SEMAPHORE_LEVEL
|
||||
#define PTW32_SEMAPHORE_LEVEL 1
|
||||
/* Include 1b, 1c and 1d */
|
||||
#endif
|
||||
|
||||
#if defined(INCLUDE_NP)
|
||||
#undef PTW32_LEVEL
|
||||
#define PTW32_LEVEL 2
|
||||
#undef PTW32_SEMAPHORE_LEVEL
|
||||
#define PTW32_SEMAPHORE_LEVEL 2
|
||||
/* Include Non-Portable extensions */
|
||||
#endif
|
||||
|
||||
#define PTW32_LEVEL_MAX 3
|
||||
#define PTW32_SEMAPHORE_LEVEL_MAX 3
|
||||
|
||||
#if !defined(PTW32_LEVEL)
|
||||
#define PTW32_LEVEL PTW32_LEVEL_MAX
|
||||
#if !defined(PTW32_SEMAPHORE_LEVEL)
|
||||
#define PTW32_SEMAPHORE_LEVEL PTW32_SEMAPHORE_LEVEL_MAX
|
||||
/* Include everything */
|
||||
#endif
|
||||
|
||||
#if __GNUC__ && ! defined (__declspec)
|
||||
#if defined(__GNUC__) && ! defined (__declspec)
|
||||
# error Please upgrade your GNU compiler to one that supports __declspec.
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When building the DLL code, you should define PTW32_BUILD so that
|
||||
* the variables/functions are exported correctly. When using the DLL,
|
||||
* When building the library, you should define PTW32_BUILD so that
|
||||
* the variables/functions are exported correctly. When using the library,
|
||||
* do NOT define PTW32_BUILD, and then the variables/functions will
|
||||
* be imported correctly.
|
||||
*/
|
||||
#ifndef PTW32_STATIC_LIB
|
||||
# ifdef PTW32_BUILD
|
||||
#if !defined(PTW32_STATIC_LIB)
|
||||
# if defined(PTW32_BUILD)
|
||||
# define PTW32_DLLPORT __declspec (dllexport)
|
||||
# else
|
||||
# define PTW32_DLLPORT __declspec (dllimport)
|
||||
|
@ -90,12 +90,15 @@
|
|||
* which is only used when building the pthread-win32 libraries.
|
||||
*/
|
||||
|
||||
#ifndef PTW32_CONFIG_H
|
||||
#if !defined(PTW32_CONFIG_H)
|
||||
# if defined(WINCE)
|
||||
# define NEED_ERRNO
|
||||
# define NEED_SEM
|
||||
# endif
|
||||
# if defined(_UWIN) || defined(__MINGW32__)
|
||||
# if defined(__MINGW64__)
|
||||
# define HAVE_STRUCT_TIMESPEC
|
||||
# define HAVE_MODE_T
|
||||
# elif defined(_UWIN) || defined(__MINGW32__)
|
||||
# define HAVE_MODE_T
|
||||
# endif
|
||||
#endif
|
||||
|
@ -104,22 +107,22 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if PTW32_LEVEL >= PTW32_LEVEL_MAX
|
||||
#ifdef NEED_ERRNO
|
||||
#if PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX
|
||||
#if defined(NEED_ERRNO)
|
||||
#include "need_errno.h"
|
||||
#else
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
|
||||
#endif /* PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX */
|
||||
|
||||
#define _POSIX_SEMAPHORES
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef HAVE_MODE_T
|
||||
#if !defined(HAVE_MODE_T)
|
||||
typedef unsigned int mode_t;
|
||||
#endif
|
||||
|
||||
|
@ -132,9 +135,9 @@ PTW32_DLLPORT int __cdecl sem_init (sem_t * sem,
|
|||
|
||||
PTW32_DLLPORT int __cdecl sem_destroy (sem_t * sem);
|
||||
|
||||
extern int sem_trywait (sem_t * sem);
|
||||
PTW32_DLLPORT int __cdecl sem_trywait (sem_t * sem);
|
||||
|
||||
extern int sem_wait (sem_t * sem);
|
||||
PTW32_DLLPORT int __cdecl sem_wait (sem_t * sem);
|
||||
|
||||
PTW32_DLLPORT int __cdecl sem_timedwait (sem_t * sem,
|
||||
const struct timespec * abstime);
|
||||
|
@ -156,11 +159,11 @@ PTW32_DLLPORT int __cdecl sem_unlink (const char * name);
|
|||
PTW32_DLLPORT int __cdecl sem_getvalue (sem_t * sem,
|
||||
int * sval);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
} /* End of extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#undef PTW32_LEVEL
|
||||
#undef PTW32_LEVEL_MAX
|
||||
#undef PTW32_SEMAPHORE_LEVEL
|
||||
#undef PTW32_SEMAPHORE_LEVEL_MAX
|
||||
|
||||
#endif /* !SEMAPHORE_H */
|
|
@ -0,0 +1,74 @@
|
|||
2011-03-26 Ross Johnson <ross at homemail dot com dot au>
|
||||
|
||||
* pthread_nutex_init.html (robust mutexes): Added
|
||||
descriptions for newly implemented interface.
|
||||
* pthread_mutexattr_init.html (robust mutexes): Likewise.
|
||||
* pthread_getsequence_np.html: New.
|
||||
* index.html: Updated.
|
||||
|
||||
2008-06-30 Ross Johnson <ross at callisto.canberra.edu.au>
|
||||
|
||||
* pthread_setschedparam.html: Fix "see also" links.
|
||||
|
||||
2005-05-06 Ross Johnson <ross at callisto.canberra.edu.au>
|
||||
|
||||
* PortabilityIssues.html: Was nonPortableIssues.html.
|
||||
* index.html: Updated; add table of contents at top.
|
||||
* *.html: Add Pthreads-win32 header info; add link back to the
|
||||
index page 'index.html'.
|
||||
|
||||
2005-05-06 Ross Johnson <ross at callisto.canberra.edu.au>
|
||||
|
||||
* index.html: New.
|
||||
* nonPortableIssues.html: New.
|
||||
* pthread_attr_init.html: New.
|
||||
* pthread_attr_setstackaddr.html: New.
|
||||
* pthread_attr_setstacksize.html: New.
|
||||
* pthread_barrierattr_init.html: New.
|
||||
* pthread_barrierattr_setpshared.html: New.
|
||||
* pthread_barrier_init.html: New.
|
||||
* pthread_barrier_wait.html: New.
|
||||
* pthreadCancelableWait.html: New.
|
||||
* pthread_cancel.html: New.
|
||||
* pthread_cleanup_push.html: New.
|
||||
* pthread_condattr_init.html: New.
|
||||
* pthread_condattr_setpshared.html: New.
|
||||
* pthread_cond_init.html: New.
|
||||
* pthread_create.html: New.
|
||||
* pthread_delay_np.html: New.
|
||||
* pthread_detach.html: New.
|
||||
* pthread_equal.html: New.
|
||||
* pthread_exit.html: New.
|
||||
* pthread_getw32threadhandle_np.html: New.
|
||||
* pthread_join.html: New.
|
||||
* pthread_key_create.html: New.
|
||||
* pthread_kill.html: New.
|
||||
* pthread_mutexattr_init.html: New.
|
||||
* pthread_mutexattr_setpshared.html: New.
|
||||
* pthread_mutex_init.html: New.
|
||||
* pthread_num_processors_np.html: New.
|
||||
* pthread_once.html: New.
|
||||
* pthread_rwlockattr_init.html: New.
|
||||
* pthread_rwlockattr_setpshared.html: New.
|
||||
* pthread_rwlock_init.html: New.
|
||||
* pthread_rwlock_rdlock.html: New.
|
||||
* pthread_rwlock_timedrdlock.html: New.
|
||||
* pthread_rwlock_timedwrlock.html: New.
|
||||
* pthread_rwlock_unlock.html: New.
|
||||
* pthread_rwlock_wrlock.html: New.
|
||||
* pthread_self.html: New.
|
||||
* pthread_setcancelstate.html: New.
|
||||
* pthread_setcanceltype.html: New.
|
||||
* pthread_setconcurrency.html: New.
|
||||
* pthread_setschedparam.html: New.
|
||||
* pthread_spin_init.html: New.
|
||||
* pthread_spin_lock.html: New.
|
||||
* pthread_spin_unlock.html: New.
|
||||
* pthread_timechange_handler_np.html: New.
|
||||
* pthread_win32_attach_detach_np.html: New.
|
||||
* pthread_win32_test_features_np.html: New.
|
||||
* sched_get_priority_max.html: New.
|
||||
* sched_getscheduler.html: New.
|
||||
* sched_setscheduler.html: New.
|
||||
* sched_yield.html: New.
|
||||
* sem_init.html: New.
|
|
@ -0,0 +1,718 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PORTABILITYISSUES manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050505;322600">
|
||||
<META NAME="CHANGED" CONTENT="20050506;11580000">
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<H4><A HREF="#toc">Table of Contents</A></H4>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P STYLE="font-weight: medium">Portability issues</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>Thread priority</B></P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<H3>Thread priority</H3>
|
||||
<P STYLE="margin-left: 2cm">POSIX defines a single contiguous range
|
||||
of numbers that determine a thread's priority. Win32 defines priority
|
||||
classes - and priority levels relative to these classes. Classes are
|
||||
simply priority base levels that the defined priority levels are
|
||||
relative to such that, changing a process's priority class will
|
||||
change the priority of all of it's threads, while the threads retain
|
||||
the same relativity to each other.</P>
|
||||
<P STYLE="margin-left: 2cm">A Win32 system defines a single
|
||||
contiguous monotonic range of values that define system priority
|
||||
levels, just like POSIX. However, Win32 restricts individual threads
|
||||
to a subset of this range on a per-process basis.</P>
|
||||
<P STYLE="margin-left: 2cm">The following table shows the base
|
||||
priority levels for combinations of priority class and priority value
|
||||
in Win32.</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DD>
|
||||
<TABLE WIDTH=742 BORDER=0 CELLPADDING=0 CELLSPACING=0 STYLE="page-break-inside: avoid">
|
||||
<COL WIDTH=50>
|
||||
<COL WIDTH=356>
|
||||
<COL WIDTH=336>
|
||||
<THEAD>
|
||||
<TR VALIGN=TOP>
|
||||
<TD WIDTH=50>
|
||||
<P ALIGN=CENTER><BR>
|
||||
</P>
|
||||
</TD>
|
||||
<TD WIDTH=356>
|
||||
<P ALIGN=LEFT><B>Process Priority Class</B></P>
|
||||
</TD>
|
||||
<TD WIDTH=336>
|
||||
<P ALIGN=LEFT><B>Thread Priority Level</B></P>
|
||||
</TD>
|
||||
</TR>
|
||||
</THEAD>
|
||||
<TBODY>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>1</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>1</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>1</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>1</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="1" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>1</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="2" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>2</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="3" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>3</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="4" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>4</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="4" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>4</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>5</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>5</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>5</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Background NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>6</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>6</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>6</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Background NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="7" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>7</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="7" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>7</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Background NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="7" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>7</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>8</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>8</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>8</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="8" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>8</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="9" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>9</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="9" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>9</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="9" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>9</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="10" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>10</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="10" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>10</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="11" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>11</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>Foreground NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="11" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>11</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="11" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>11</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="12" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>12</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="12" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>12</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="13" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>13</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="14" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>14</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>15</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>15</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>HIGH_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>15</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>IDLE_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>15</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>BELOW_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>15</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="15" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>15</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>ABOVE_NORMAL_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="16" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>16</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_IDLE</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="17" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>17</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="-7" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>-7</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="18" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>18</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="-6" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>-6</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="19" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>19</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="-5" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>-5</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="20" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>20</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="-4" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>-4</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="21" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>21</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="-3" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>-3</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="22" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>22</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_LOWEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="23" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>23</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_BELOW_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="24" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>24</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="25" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>25</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_ABOVE_NORMAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="26" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>26</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_HIGHEST</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="27" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>27</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="3" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>3</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="28" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>28</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="4" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>4</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="29" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>29</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="5" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>5</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="30" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>30</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=BOTTOM SDVAL="6" SDNUM="3081;">
|
||||
<P ALIGN=LEFT>6</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH=50 VALIGN=BOTTOM SDVAL="31" SDNUM="3081;">
|
||||
<P ALIGN=CENTER>31</P>
|
||||
</TD>
|
||||
<TD WIDTH=356 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>REALTIME_PRIORITY_CLASS</P>
|
||||
</TD>
|
||||
<TD WIDTH=336 VALIGN=TOP>
|
||||
<P ALIGN=LEFT>THREAD_PRIORITY_TIME_CRITICAL</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TBODY>
|
||||
</TABLE>
|
||||
</DL>
|
||||
</DL>
|
||||
<P STYLE="margin-left: 2cm">Windows NT: Values -7, -6, -5, -4, -3, 3,
|
||||
4, 5, and 6 are not supported.</P>
|
||||
<P STYLE="margin-left: 2cm">As you can see, the real priority levels
|
||||
available to any individual Win32 thread are non-contiguous.</P>
|
||||
<P STYLE="margin-left: 2cm">An application using Pthreads-w32 should
|
||||
not make assumptions about the numbers used to represent thread
|
||||
priority levels, except that they are monotonic between the values
|
||||
returned by sched_get_priority_min() and sched_get_priority_max().
|
||||
E.g. Windows 95, 98, NT, 2000, XP make available a non-contiguous
|
||||
range of numbers between -15 and 15, while at least one version of
|
||||
WinCE (3.0) defines the minimum priority (THREAD_PRIORITY_LOWEST) as
|
||||
5, and the maximum priority (THREAD_PRIORITY_HIGHEST) as 1.</P>
|
||||
<P STYLE="margin-left: 2cm">Internally, pthreads-win32 maps any
|
||||
priority levels between THREAD_PRIORITY_IDLE and
|
||||
THREAD_PRIORITY_LOWEST to THREAD_PRIORITY_LOWEST, or between
|
||||
THREAD_PRIORITY_TIME_CRITICAL and THREAD_PRIORITY_HIGHEST to
|
||||
THREAD_PRIORITY_HIGHEST. Currently, this also applies to
|
||||
REALTIME_PRIORITY_CLASS even if levels -7, -6, -5, -4, -3, 3, 4, 5,
|
||||
and 6 are supported.</P>
|
||||
<P STYLE="margin-left: 2cm">If it wishes, a Win32 application using
|
||||
pthreads-w32 can use the Win32 defined priority macros
|
||||
THREAD_PRIORITY_IDLE through THREAD_PRIORITY_TIME_CRITICAL.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Author</A></H2>
|
||||
<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">See also</A></H2>
|
||||
<P><BR><BR>
|
||||
</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect4" NAME="toc4">See also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,158 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE></TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;17350500">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGED" CONTENT="20110326;18352700">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
H4.cjk { font-family: "AR PL UMing CN" }
|
||||
H4.ctl { font-family: "Lohit Devanagari" }
|
||||
H3.cjk { font-family: "AR PL UMing CN" }
|
||||
H3.ctl { font-family: "Lohit Devanagari" }
|
||||
H2.cjk { font-family: "AR PL UMing CN" }
|
||||
H2.ctl { font-family: "Lohit Devanagari" }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" DIR="LTR">
|
||||
<H4 CLASS="western">POSIX Threads for Windows – REFERENCE -
|
||||
<A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<H3 CLASS="western">Table of Contents</H3>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="#sect1" NAME="toc1">POSIX
|
||||
threads API reference</A><BR><A HREF="#sect2" NAME="toc2">Miscellaneous
|
||||
POSIX thread safe routines provided by Pthreads-w32</A><BR><A HREF="#sect3" NAME="toc3">Non-portable
|
||||
Pthreads-w32 routines</A><BR><A HREF="#sect4" NAME="toc4">Other</A></P>
|
||||
<H2 CLASS="western"><A HREF="#toc1" NAME="sect1">POSIX threads API
|
||||
reference</A></H2>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_getinheritsched</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_getschedparam</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_getschedpolicy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_getscope</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_getstackaddr</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_setstacksize.html"><B>pthread_attr_getstacksize</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_setdetachstate</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_setinheritsched</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_setschedparam</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_setschedpolicy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_init.html"><B>pthread_attr_setscope</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_setstackaddr</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_attr_setstacksize.html"><B>pthread_attr_setstacksize</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_getpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_setpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrier_init.html"><B>pthread_barrier_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrier_init.html"><B>pthread_barrier_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cancel.html"><B>pthread_cancel</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_pop</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_condattr_init.html"><B>pthread_condattr_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_condattr_setpshared.html"><B>pthread_condattr_getpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_condattr_init.html"><B>pthread_condattr_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_condattr_setpshared.html"><B>pthread_condattr_setpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cond_init.html"><B>pthread_cond_broadcast</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cond_init.html"><B>pthread_cond_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cond_init.html"><B>pthread_cond_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cond_init.html"><B>pthread_cond_signal</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cond_init.html"><B>pthread_cond_timedwait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cond_init.html"><B>pthread_cond_wait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_create.html"><B>pthread_create</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_detach.html"><B>pthread_detach</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_equal.html"><B>pthread_equal</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_exit.html"><B>pthread_exit</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_setconcurrency.html"><B>pthread_getconcurrency</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_setschedparam.html"><B>pthread_getschedparam</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_getunique_np.html"><B>pthread_getunique_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_key_create.html"><B>pthread_getspecific</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_join.html"><B>pthread_join</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_key_create.html"><B>pthread_key_create</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_key_create.html"><B>pthread_key_delete</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_kill.html"><B>pthread_kill</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_getkind_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_setpshared.html"><B>pthread_mutexattr_getpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_getrobust</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_gettype</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_setkind_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_setpshared.html"><B>pthread_mutexattr_setpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_setrobust</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_settype</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_consistent</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_lock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_timedlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_trylock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_mutex_init.html"><B>pthread_mutex_unlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_once.html"><B>pthread_once</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlockattr_init.html"><B>pthread_rwlockattr_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_getpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlockattr_init.html"><B>pthread_rwlockattr_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_setpshared</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_unlock.html"><B>pthread_rwlock_unlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_self.html"><B>pthread_self</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cancel.html"><B>pthread_setcancelstate</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cancel.html"><B>pthread_setcanceltype</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_setconcurrency.html"><B>pthread_setconcurrency</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_key_create.html"><B>pthread_setspecific</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_kill.html"><B>pthread_sigmask</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_spin_init.html"><B>pthread_spin_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_spin_init.html"><B>pthread_spin_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_spin_lock.html"><B>pthread_spin_trylock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_spin_unlock.html"><B>pthread_spin_unlock</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_cancel.html"><B>pthread_testcancel</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sched_get_priority_max.html"><B>sched_get_priority_max</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sched_get_priority_max.html"><B>sched_get_priority_min</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sched_getscheduler.html"><B>sched_getscheduler</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sched_setscheduler.html"><B>sched_setscheduler</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sched_yield.html"><B>sched_yield</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><B>sem_close</B></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_destroy</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_getvalue</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_init</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><B>sem_open</B></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_post</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_post_multiple</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_timedwait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_trywait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><B>sem_unlink</B></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="sem_init.html"><B>sem_wait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_kill.html"><B>sigwait</B></A></P>
|
||||
<H2 CLASS="western"><A HREF="#toc3" NAME="sect3">Non-portable
|
||||
Pthreads-w32 routines</A></H2>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthreadCancelableWait.html"><B>pthreadCancelableTimedWait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthreadCancelableWait.html"><B>pthreadCancelableWait</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_delay_np.html"><B>pthread_delay_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_getw32threadhandle_np.html"><B>pthread_getw32threadhandle_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_num_processors_np.html"><B>pthread_num_processors_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_win32_test_features_np.html"><B>pthread_win32_test_features_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_timechange_handler_np.html"><B>pthread_timechange_handler_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_process_attach_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_process_detach_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_thread_attach_np</B></A></P>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="pthread_win32_attach_detach_np.html"><B>pthread_win32_thread_detach_np</B></A></P>
|
||||
<H2 CLASS="western"><A HREF="#toc4" NAME="sect4">Other</A></H2>
|
||||
<P STYLE="margin-left: 0.79in"><A HREF="PortabilityIssues.html"><B>Portability
|
||||
issues</B></A></P>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREADCANCELLABLEWAIT manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050505;322600">
|
||||
<META NAME="CHANGED" CONTENT="20050505;23242300">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P STYLE="font-weight: medium">pthreadCancelableTimedWait,
|
||||
pthreadCancelableWait – provide cancellation hooks for user Win32
|
||||
routines</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthreadCancelableTimedWait (HANDLE </B><I>waitHandle</I><B>,
|
||||
DWORD </B><I>timeout</I><B>);</B></P>
|
||||
<P><B>int pthreadCancelableWait (HANDLE </B><I>waitHandle</I><B>);</B></P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>These two functions provide hooks into the <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>()
|
||||
mechanism that will allow you to wait on a Windows handle and make it
|
||||
a cancellation point. Both functions block until either the given
|
||||
Win32 <B>HANDLE</B> is signalled, or <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>()
|
||||
has been called. They are implemented using <B>WaitForMultipleObjects</B>
|
||||
on <I>waitHandle</I> and the manually reset Win32 event handle that
|
||||
is the target of <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>().
|
||||
These routines may be called from Win32 native threads but
|
||||
<A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>() will
|
||||
require that thread's POSIX thread ID that the thread must retrieve
|
||||
using <A HREF="pthread_self.html"><B>pthread_self</B></A>().</P>
|
||||
<P><B>pthreadCancelableTimedWait</B> is the timed version that will
|
||||
return with the code <B>ETIMEDOUT</B> if the interval <I>timeout</I>
|
||||
milliseconds elapses before <I>waitHandle</I> is signalled.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P>These routines allow routines that block on Win32 HANDLEs to be
|
||||
cancellable via <A HREF="pthread_cancel.html"><B>pthread_cancel</B></A>().</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
|
||||
<P><BR><BR>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
|
||||
<P>The <B>pthreadCancelableTimedWait</B> function returns the
|
||||
following error code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<P STYLE="margin-left: 2cm">
|
||||
The interval <I>timeout</I> milliseconds elapsed before <I>waitHandle</I>
|
||||
was signalled.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Author</A></H2>
|
||||
<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">See also</A></H2>
|
||||
<P><A HREF="pthread_cancel.html"><B>pthread_cancel()</B></A>,
|
||||
<A HREF="pthread_self.html"><B>pthread_self()</B></A></P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4"></A><A HREF="#sect4" NAME="toc4">Return
|
||||
Value</A><A HREF="#sect4" NAME="toc4"></A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect7" NAME="toc7">See also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,280 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_ATTR_INIT(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;10092900">
|
||||
<META NAME="CHANGED" CONTENT="20050505;16540200">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_attr_init, pthread_attr_destroy,
|
||||
pthread_attr_setdetachstate, pthread_attr_getdetachstate,
|
||||
pthread_attr_setschedparam, pthread_attr_getschedparam,
|
||||
pthread_attr_setschedpolicy, pthread_attr_getschedpolicy,
|
||||
pthread_attr_setinheritsched, pthread_attr_getinheritsched,
|
||||
pthread_attr_setscope, pthread_attr_getscope - thread creation
|
||||
attributes
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_init(pthread_attr_t *</B><I>attr</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_destroy(pthread_attr_t *</B><I>attr</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_setdetachstate(pthread_attr_t *</B><I>attr</I><B>,
|
||||
int </B><I>detachstate</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getdetachstate(const pthread_attr_t *</B><I>attr</I><B>,
|
||||
int *</B><I>detachstate</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_setschedpolicy(pthread_attr_t *</B><I>attr</I><B>,
|
||||
int </B><I>policy</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getschedpolicy(const pthread_attr_t *</B><I>attr</I><B>,
|
||||
int *</B><I>policy</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_setschedparam(pthread_attr_t *</B><I>attr</I><B>,
|
||||
const struct sched_param *</B><I>param</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getschedparam(const pthread_attr_t *</B><I>attr</I><B>,
|
||||
struct sched_param *</B><I>param</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_setinheritsched(pthread_attr_t *</B><I>attr</I><B>,
|
||||
int </B><I>inherit</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getinheritsched(const pthread_attr_t *</B><I>attr</I><B>,
|
||||
int *</B><I>inherit</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_setscope(pthread_attr_t *</B><I>attr</I><B>,
|
||||
int </B><I>scope</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getscope(const pthread_attr_t *</B><I>attr</I><B>,
|
||||
int *</B><I>scope</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Setting attributes for threads is achieved by filling a thread
|
||||
attribute object <I>attr</I> of type <B>pthread_attr_t</B>, then
|
||||
passing it as second argument to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A>
|
||||
. Passing <B>NULL</B> is equivalent to passing a thread attribute
|
||||
object with all attributes set to their default values.
|
||||
</P>
|
||||
<P><B>pthread_attr_init</B> initializes the thread attribute object
|
||||
<I>attr</I> and fills it with default values for the attributes. (The
|
||||
default values are listed below for each attribute.)
|
||||
</P>
|
||||
<P>Each attribute <I>attrname</I> (see below for a list of all
|
||||
attributes) can be individually set using the function
|
||||
<B>pthread_attr_set</B><I>attrname</I> and retrieved using the
|
||||
function <B>pthread_attr_get</B><I>attrname.</I>
|
||||
</P>
|
||||
<P><B>pthread_attr_destroy</B> destroys a thread attribute object,
|
||||
which must not then be reused until it is reinitialized.
|
||||
</P>
|
||||
<P>Attribute objects are consulted only when creating a new thread.
|
||||
The same attribute object can be used for creating several threads.
|
||||
Modifying an attribute object after a call to <B>pthread_create</B>
|
||||
does not change the attributes of the thread previously created.
|
||||
</P>
|
||||
<P>The following thread attributes are supported:
|
||||
</P>
|
||||
<H3><A HREF="#toc3" NAME="sect3">detachstate</A></H3>
|
||||
<P>Control whether the thread is created in the joinable state (value
|
||||
<B>PTHREAD_CREATE_JOINABLE</B>) or in the detached state (
|
||||
<B>PTHREAD_CREATE_DETACHED</B>).
|
||||
</P>
|
||||
<P>Default value: <B>PTHREAD_CREATE_JOINABLE</B>.
|
||||
</P>
|
||||
<P>In the joinable state, another thread can synchronize on the
|
||||
thread termination and recover its termination code using
|
||||
<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> . When a
|
||||
joinable thread terminates, some of the thread resources are kept
|
||||
allocated, and released only when another thread performs
|
||||
<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> on that
|
||||
thread.
|
||||
</P>
|
||||
<P>In the detached state, the thread's resources are released
|
||||
immediately when it terminates. <A HREF="pthread_join.html"><B>pthread_join</B>(3)</A>
|
||||
cannot be used to synchronize on the thread termination.
|
||||
</P>
|
||||
<P>A thread created in the joinable state can later be put in the
|
||||
detached thread using <A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A>
|
||||
.
|
||||
</P>
|
||||
<H3><A HREF="#toc4" NAME="sect4">schedpolicy</A></H3>
|
||||
<P>Select the scheduling policy for the thread: one of <B>SCHED_OTHER</B>
|
||||
(regular, non-real-time scheduling), <B>SCHED_RR</B> (real-time,
|
||||
round-robin) or <B>SCHED_FIFO</B> (real-time, first-in first-out).
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> only supports <B>SCHED_OTHER</B> - attempting
|
||||
to set one of the other policies will return an error ENOTSUP.</P>
|
||||
<P>Default value: <B>SCHED_OTHER</B>.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> only supports <B>SCHED_OTHER</B> - attempting
|
||||
to set one of the other policies will return an error ENOTSUP.</P>
|
||||
<P>The scheduling policy of a thread can be changed after creation
|
||||
with <A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A>
|
||||
.
|
||||
</P>
|
||||
<H3><A HREF="#toc5" NAME="sect5">schedparam</A></H3>
|
||||
<P>Contain the scheduling parameters (essentially, the scheduling
|
||||
priority) for the thread.</P>
|
||||
<P><B>Pthreads-w32</B> supports the priority levels defined by the
|
||||
Windows system it is running on. Under Windows, thread priorities are
|
||||
relative to the process priority class, which must be set via the
|
||||
Windows W32 API.</P>
|
||||
<P>Default value: priority is 0 (Win32 level <B>THREAD_PRIORITY_NORMAL</B>).
|
||||
</P>
|
||||
<P>The scheduling priority of a thread can be changed after creation
|
||||
with <A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A>
|
||||
.
|
||||
</P>
|
||||
<H3><A HREF="#toc6" NAME="sect6">inheritsched</A></H3>
|
||||
<P>Indicate whether the scheduling policy and scheduling parameters
|
||||
for the newly created thread are determined by the values of the
|
||||
<I>schedpolicy</I> and <I>schedparam</I> attributes (value
|
||||
<B>PTHREAD_EXPLICIT_SCHED</B>) or are inherited from the parent
|
||||
thread (value <B>PTHREAD_INHERIT_SCHED</B>).
|
||||
</P>
|
||||
<P>Default value: <B>PTHREAD_EXPLICIT_SCHED</B>.
|
||||
</P>
|
||||
<H3><A HREF="#toc7" NAME="sect7">scope</A></H3>
|
||||
<P>Define the scheduling contention scope for the created thread. The
|
||||
only value supported in the <B>Pthreads-w32</B> implementation is
|
||||
<B>PTHREAD_SCOPE_SYSTEM</B>, meaning that the threads contend for CPU
|
||||
time with all processes running on the machine. The other value
|
||||
specified by the standard, <B>PTHREAD_SCOPE_PROCESS</B>, means that
|
||||
scheduling contention occurs only between the threads of the running
|
||||
process.</P>
|
||||
<P><B>Pthreads-w32</B> only supports <B>PTHREAD_SCOPE_SYSTEM</B>.</P>
|
||||
<P>Default value: <B>PTHREAD_SCOPE_SYSTEM</B>.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Return Value</A></H2>
|
||||
<P>All functions return 0 on success and a non-zero error code on
|
||||
error. On success, the <B>pthread_attr_get</B><I>attrname</I>
|
||||
functions also store the current value of the attribute <I>attrname</I>
|
||||
in the location pointed to by their second argument.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">Errors</A></H2>
|
||||
<P>The <B>pthread_attr_setdetachstate</B> function returns the
|
||||
following error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the specified <I>detachstate</I> is not one of
|
||||
<B>PTHREAD_CREATE_JOINABLE</B> or <B>PTHREAD_CREATE_DETACHED</B>.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_attr_setschedparam</B> function returns the following
|
||||
error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the priority specified in <I>param</I> is outside the range of
|
||||
allowed priorities for the scheduling policy currently in <I>attr</I>
|
||||
(1 to 99 for <B>SCHED_FIFO</B> and <B>SCHED_RR</B>; 0 for
|
||||
<B>SCHED_OTHER</B>).
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_attr_setschedpolicy</B> function returns the following
|
||||
error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the specified <I>policy</I> is not one of <B>SCHED_OTHER</B>,
|
||||
<B>SCHED_FIFO</B>, or <B>SCHED_RR</B>.
|
||||
</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<B>ENOTSUP</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<I>policy</I> is not <B>SCHED_OTHER</B>, the only value supported
|
||||
by <B>Pthreads-w32</B>.</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_attr_setinheritsched</B> function returns the
|
||||
following error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the specified <I>inherit</I> is not one of <B>PTHREAD_INHERIT_SCHED</B>
|
||||
or <B>PTHREAD_EXPLICIT_SCHED</B>.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_attr_setscope</B> function returns the following error
|
||||
codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the specified <I>scope</I> is not one of <B>PTHREAD_SCOPE_SYSTEM</B>
|
||||
or <B>PTHREAD_SCOPE_PROCESS</B>.
|
||||
</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<B>ENOTSUP</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the specified <I>scope</I> is <B>PTHREAD_SCOPE_PROCESS</B> (not
|
||||
supported by <B>Pthreads-w32</B>).
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<H2>
|
||||
<A HREF="#toc10" NAME="sect10">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc11" NAME="sect11">See Also</A></H2>
|
||||
<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> ,
|
||||
<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> ,
|
||||
<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> ,
|
||||
<A HREF="pthread_setschedparam.html"><B>pthread_setschedparam</B>(3)</A>
|
||||
.
|
||||
</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">detachstate</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">schedpolicy</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">schedparam</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">inheritsched</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">scope</A>
|
||||
</P>
|
||||
</UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect10" NAME="toc10">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect11" NAME="toc11">See Also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,158 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_ATTR_GETSTACKADDR"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;11025500">
|
||||
<META NAME="CHANGED" CONTENT="20050505;17571400">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_attr_getstackaddr, pthread_attr_setstackaddr - get and set
|
||||
the stackaddr attribute
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getstackaddr(const pthread_attr_t *restrict</B>
|
||||
<I>attr</I><B>, void **restrict</B> <I>stackaddr</I><B>); <BR>int
|
||||
pthread_attr_setstackaddr(pthread_attr_t *</B><I>attr</I><B>, void
|
||||
*</B><I>stackaddr</I><B>); </B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_attr_getstackaddr</B> and <B>pthread_attr_setstackaddr</B>
|
||||
functions, respectively, shall get and set the thread creation
|
||||
<I>stackaddr</I> attribute in the <I>attr</I> object.
|
||||
</P>
|
||||
<P>The <I>stackaddr</I> attribute specifies the location of storage
|
||||
to be used for the created thread’s stack. The size of the storage
|
||||
shall be at least {PTHREAD_STACK_MIN}.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_ATTR_STACKADDR</B> in
|
||||
pthread.h as -1 to indicate that these routines are implemented but
|
||||
cannot used to set or get the stack address. These routines always
|
||||
return the error ENOSYS when called.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>Upon successful completion, <B>pthread_attr_getstackaddr</B> and
|
||||
<B>pthread_attr_setstackaddr</B> shall return a value of 0;
|
||||
otherwise, an error number shall be returned to indicate the error.
|
||||
</P>
|
||||
<P>The <B>pthread_attr_getstackaddr</B> function stores the <I>stackaddr</I>
|
||||
attribute value in <I>stackaddr</I> if successful.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_attr_setstackaddr</B> function always returns the
|
||||
following error code:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOSYS</B></DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The function is not supported.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_attr_getstackaddr</B> function always returns the
|
||||
following error code:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOSYS</B></DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The function is not supported.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
These functions shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P>The specification of the <I>stackaddr</I> attribute presents
|
||||
several ambiguities that make portable use of these interfaces
|
||||
impossible. The description of the single address parameter as a
|
||||
"stack" does not specify a particular relationship between
|
||||
the address and the "stack" implied by that address. For
|
||||
example, the address may be taken as the low memory address of a
|
||||
buffer intended for use as a stack, or it may be taken as the address
|
||||
to be used as the initial stack pointer register value for the new
|
||||
thread. These two are not the same except for a machine on which the
|
||||
stack grows "up" from low memory to high, and on which a
|
||||
"push" operation first stores the value in memory and then
|
||||
increments the stack pointer register. Further, on a machine where
|
||||
the stack grows "down" from high memory to low,
|
||||
interpretation of the address as the "low memory" address
|
||||
requires a determination of the intended size of the stack.
|
||||
IEEE Std 1003.1-2001 has introduced the new interfaces
|
||||
<A HREF="pthread_attr_setstack.html"><B>pthread_attr_setstack</B>(3)</A>
|
||||
and <A HREF="pthread_attr_getstack.html"><B>pthread_attr_getstack</B>(3)</A>
|
||||
to resolve these ambiguities.
|
||||
</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B>(3)</A>
|
||||
, <A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B>(3)</A>
|
||||
, <A HREF="pthread_attr_getstack.html"><B>pthread_attr_getstack</B>(3)</A>
|
||||
, <A HREF="pthread_attr_getstacksize.html"><B>pthread_attr_getstacksize</B>(3)</A>
|
||||
, <A HREF="pthread_attr_setstack.html"><B>pthread_attr_setstack</B>(3)</A>
|
||||
, <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> , the
|
||||
Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><limits.h></I>, <I><pthread.h></I>
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,127 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_ATTR_GETSTACKSIZE"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;11224900">
|
||||
<META NAME="CHANGED" CONTENT="20050505;18003200">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_attr_getstacksize, pthread_attr_setstacksize - get and set
|
||||
the stacksize attribute
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P><B>int pthread_attr_getstacksize(const pthread_attr_t *restrict</B>
|
||||
<I>attr</I><B>, size_t *restrict</B> <I>stacksize</I><B>); <BR>int
|
||||
pthread_attr_setstacksize(pthread_attr_t *</B><I>attr</I><B>, size_t</B>
|
||||
<I>stacksize</I><B>); </B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_attr_getstacksize</B> and <B>pthread_attr_setstacksize</B>
|
||||
functions, respectively, shall get and set the thread creation
|
||||
<I>stacksize</I> attribute in the <I>attr</I> object.
|
||||
</P>
|
||||
<P>The <I>stacksize</I> attribute shall define the minimum stack size
|
||||
(in bytes) allocated for the created threads stack.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_ATTR_STACKSIZE</B> in
|
||||
pthread.h to indicate that these routines are implemented and may be
|
||||
used to set or get the stack size.</P>
|
||||
<P>Default value: 0 (in Pthreads-w32 a value of 0 means the stack
|
||||
will grow as required)</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>Upon successful completion, <B>pthread_attr_getstacksize</B> and
|
||||
<B>pthread_attr_setstacksize</B> shall return a value of 0;
|
||||
otherwise, an error number shall be returned to indicate the error.
|
||||
</P>
|
||||
<P>The <B>pthread_attr_getstacksize</B> function stores the <I>stacksize</I>
|
||||
attribute value in <I>stacksize</I> if successful.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_attr_setstacksize</B> function shall fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value of <I>stacksize</I> is less than {PTHREAD_STACK_MIN} or
|
||||
exceeds a system-imposed limit.
|
||||
</DD></DL>
|
||||
<P>
|
||||
These functions shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_attr_init.html"><B>pthread_attr_destroy</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_attr_setstackaddr.html"><B>pthread_attr_getstackaddr</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_attr_init.html"><B>pthread_attr_getdetachstate</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> <B>,</B>
|
||||
the Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><limits.h></I>, <I><pthread.h></I>
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,197 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_BARRIER_DESTROY"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;11372800">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGED" CONTENT="20060408;9450100">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_barrier_destroy, pthread_barrier_init - destroy and
|
||||
initialize a barrier object (<B>ADVANCED REALTIME THREADS</B>)
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P><B>int pthread_barrier_destroy(pthread_barrier_t *</B><I>barrier</I><B>);
|
||||
<BR>int pthread_barrier_init(pthread_barrier_t *restrict</B> <I>barrier</I><B>,
|
||||
const pthread_barrierattr_t *restrict</B> <I>attr</I><B>, unsigned</B>
|
||||
<I>count</I><B>); </B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_barrier_destroy</B> function shall destroy the
|
||||
barrier referenced by <I>barrier</I> and release any resources used
|
||||
by the barrier. The effect of subsequent use of the barrier is
|
||||
undefined until the barrier is reinitialized by another call to
|
||||
<B>pthread_barrier_init</B> . An implementation may use this function
|
||||
to set <I>barrier</I> to an invalid value. An error code is returned if <B>pthread_barrier_destroy</B> is called when any thread is
|
||||
blocked on the barrier, or if this function is called with an
|
||||
uninitialized barrier.
|
||||
</P>
|
||||
<P>The <B>pthread_barrier_init</B> function shall allocate any
|
||||
resources required to use the barrier referenced by <I>barrier</I>
|
||||
and shall initialize the barrier with attributes referenced by <I>attr</I>.
|
||||
If <I>attr</I> is NULL, the default barrier attributes shall be used;
|
||||
the effect is the same as passing the address of a default barrier
|
||||
attributes object. The results are undefined if <B>pthread_barrier_init</B>
|
||||
is called when any thread is blocked on the barrier (that is, has not
|
||||
returned from the <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
call). The results are undefined if a barrier is used without first
|
||||
being initialized. The results are undefined if <B>pthread_barrier_init</B>
|
||||
is called specifying an already initialized barrier.
|
||||
</P>
|
||||
<P>The <I>count</I> argument specifies the number of threads that
|
||||
must call <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
before any of them successfully return from the call. The value
|
||||
specified by <I>count</I> must be greater than zero.
|
||||
</P>
|
||||
<P>If the <B>pthread_barrier_init</B> function fails, the barrier
|
||||
shall not be initialized and the contents of <I>barrier</I> are
|
||||
undefined.
|
||||
</P>
|
||||
<P>Only the object referenced by <I>barrier</I> may be used for
|
||||
performing synchronization. The result of referring to copies of that
|
||||
object in calls to <B>pthread_barrier_destroy</B> <B>or</B>
|
||||
<A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
is undefined.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>Upon successful completion, these functions shall return zero;
|
||||
otherwise, an error number shall be returned to indicate the error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_barrier_destroy</B> function may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EBUSY</B>
|
||||
</DT><DD>
|
||||
The implementation has detected an attempt to destroy a barrier
|
||||
while it is in use (for example, while being used in a
|
||||
<A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
call) by another thread.
|
||||
</DD><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>barrier</I> is invalid.
|
||||
</DD></DL>
|
||||
<P>
|
||||
The <B>pthread_barrier_init</B> function shall fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EAGAIN</B>
|
||||
</DT><DD>
|
||||
The system lacks the necessary resources to initialize another
|
||||
barrier.
|
||||
</DD><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD>
|
||||
The value specified by <I>count</I> is equal to zero.
|
||||
</DD><DT>
|
||||
<B>ENOMEM</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
Insufficient memory exists to initialize the barrier.
|
||||
</DD></DL>
|
||||
<P>
|
||||
The <B>pthread_barrier_init</B> function may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EBUSY</B>
|
||||
</DT><DD>
|
||||
The implementation has detected an attempt to reinitialize a barrier
|
||||
while it is in use (for example, while being used in a
|
||||
<A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
call) by another thread.
|
||||
</DD><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>attr</I> is invalid.
|
||||
</DD></DL>
|
||||
<P>
|
||||
These functions shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P>The <B>pthread_barrier_destroy</B> and <B>pthread_barrier_init</B>
|
||||
functions are part of the Barriers option and need not be provided on
|
||||
all implementations.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate
|
||||
that these routines are implemented and may be used.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc11" NAME="sect11">Known Bugs</A></H2>
|
||||
<DL>
|
||||
<DD STYLE="margin-left: 0cm; margin-bottom: 0.5cm">In
|
||||
<B><SPAN LANG="en-GB"><SPAN LANG="en-GB">pthreads-win32</SPAN></SPAN></B>,
|
||||
the behaviour of threads which enter <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
while the barrier is being destroyed is undefined.
|
||||
</DD></DL>
|
||||
<H2>
|
||||
<A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
|
||||
<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><pthread.h></I>
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect11" NAME="toc11">Known
|
||||
Bugs</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,161 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_BARRIER_WAIT"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;11484200">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGED" CONTENT="20060408;9504600">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_barrier_wait - synchronize at a barrier (<B>ADVANCED
|
||||
REALTIME THREADS</B>)
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P><B>int pthread_barrier_wait(pthread_barrier_t *</B><I>barrier</I><B>);
|
||||
</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_barrier_wait</B> function shall synchronize
|
||||
participating threads at the barrier referenced by <I>barrier</I>.
|
||||
The calling thread shall block until the required number of threads
|
||||
have called <B>pthread_barrier_wait</B> specifying the barrier.
|
||||
</P>
|
||||
<P>When the required number of threads have called
|
||||
<B>pthread_barrier_wait</B> specifying the barrier, the constant
|
||||
<B>PTHREAD_BARRIER_SERIAL_THREAD</B> shall be returned to one
|
||||
unspecified thread and zero shall be returned to each of the
|
||||
remaining threads. At this point, the barrier shall be reset to the
|
||||
state it had as a result of the most recent <A HREF="pthread_barrier_init.html"><B>pthread_barrier_init</B>(3)</A>
|
||||
function that referenced it.
|
||||
</P>
|
||||
<P>The constant <B>PTHREAD_BARRIER_SERIAL_THREAD</B> is defined in
|
||||
<I><pthread.h></I> and its value shall be distinct from any
|
||||
other value returned by <B>pthread_barrier_wait</B> .
|
||||
</P>
|
||||
<P>The results are undefined if this function is called with an
|
||||
uninitialized barrier.
|
||||
</P>
|
||||
<P>If a signal is delivered to a thread blocked on a barrier, upon
|
||||
return from the signal handler the thread shall resume waiting at the
|
||||
barrier if the barrier wait has not completed (that is, if the
|
||||
required number of threads have not arrived at the barrier during the
|
||||
execution of the signal handler); otherwise, the thread shall
|
||||
continue as normal from the completed barrier wait. Until the thread
|
||||
in the signal handler returns from it, it is unspecified whether
|
||||
other threads may proceed past the barrier once they have all reached
|
||||
it.
|
||||
</P>
|
||||
<P>A thread that has blocked on a barrier shall not prevent any
|
||||
unblocked thread that is eligible to use the same processing
|
||||
resources from eventually making forward progress in its execution.
|
||||
Eligibility for processing resources shall be determined by the
|
||||
scheduling policy.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>Upon successful completion, the <B>pthread_barrier_wait</B>
|
||||
function shall return <B>PTHREAD_BARRIER_SERIAL_THREAD</B> for a
|
||||
single (arbitrary) thread synchronized at the barrier and zero for
|
||||
each of the other threads. Otherwise, an error number shall be
|
||||
returned to indicate the error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_barrier_wait</B> function may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>barrier</I> does not refer to an
|
||||
initialized barrier object.
|
||||
</DD></DL>
|
||||
<P>
|
||||
This function shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P>Applications using this function may be subject to priority
|
||||
inversion, as discussed in the Base Definitions volume of
|
||||
IEEE Std 1003.1-2001, Section 3.285, Priority Inversion.
|
||||
</P>
|
||||
<P>The <B>pthread_barrier_wait</B> function is part of the Barriers
|
||||
option and need not be provided on all implementations.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate
|
||||
that this routine is implemented and may be used.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc11" NAME="sect11">Known Bugs</A></H2>
|
||||
<DL>
|
||||
None.</DL>
|
||||
<H2>
|
||||
<A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_barrier_init.html"><B>pthread_barrier_destroy</B>(3)</A>,
|
||||
<A HREF="pthread_barrier_init.html"><B>pthread_barrier_init(3)</B></A>,
|
||||
the Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><pthread.h></I>
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect11" NAME="toc11">Known
|
||||
Bugs</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,142 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_BARRIERATTR_DESTROY"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;11502600">
|
||||
<META NAME="CHANGED" CONTENT="20050505;18032300">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_barrierattr_destroy, pthread_barrierattr_init - destroy
|
||||
and initialize the barrier attributes object (<B>ADVANCED REALTIME
|
||||
THREADS</B>)
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P>i<B>nt pthread_barrierattr_destroy(pthread_barrierattr_t *</B><I>attr</I><B>);
|
||||
<BR>int pthread_barrierattr_init(pthread_barrierattr_t *</B><I>attr</I><B>);
|
||||
</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_barrierattr_destroy</B> function shall destroy a
|
||||
barrier attributes object. A destroyed <I>attr</I> attributes object
|
||||
can be reinitialized using <B>pthread_barrierattr_init</B> ; the
|
||||
results of otherwise referencing the object after it has been
|
||||
destroyed are undefined. An implementation may cause
|
||||
<B>pthread_barrierattr_destroy</B> to set the object referenced by
|
||||
<I>attr</I> to an invalid value.
|
||||
</P>
|
||||
<P>The <B>pthread_barrierattr_init</B> function shall initialize a
|
||||
barrier attributes object <I>attr</I> with the default value for all
|
||||
of the attributes defined by the implementation.
|
||||
</P>
|
||||
<P>Results are undefined if <B>pthread_barrierattr_init</B> is called
|
||||
specifying an already initialized <I>attr</I> attributes object.
|
||||
</P>
|
||||
<P>After a barrier attributes object has been used to initialize one
|
||||
or more barriers, any function affecting the attributes object
|
||||
(including destruction) shall not affect any previously initialized
|
||||
barrier.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>If successful, the <B>pthread_barrierattr_destroy</B> and
|
||||
<B>pthread_barrierattr_init</B> functions shall return zero;
|
||||
otherwise, an error number shall be returned to indicate the error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_barrierattr_destroy</B> function may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>attr</I> is invalid.
|
||||
</DD></DL>
|
||||
<P>
|
||||
The <B>pthread_barrierattr_init</B> function shall fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>ENOMEM</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
Insufficient memory exists to initialize the barrier attributes
|
||||
object.
|
||||
</DD></DL>
|
||||
<P>
|
||||
These functions shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P>The <B>pthread_barrierattr_destroy</B> and
|
||||
<B>pthread_barrierattr_init</B> functions are part of the Barriers
|
||||
option and need not be provided on all implementations.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate
|
||||
that these routines are implemented and may be used.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_getpshared</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_barrierattr_setpshared.html"><B>pthread_barrierattr_setpshared</B>(3)</A>
|
||||
, the Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><pthread.h></I>.
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,159 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_BARRIERATTR_GETPSHARED"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;11552100">
|
||||
<META NAME="CHANGED" CONTENT="20050505;18080400">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_barrierattr_getpshared, pthread_barrierattr_setpshared -
|
||||
get and set the process-shared attribute of the barrier attributes
|
||||
object (<B>ADVANCED REALTIME THREADS</B>)
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P><B>int pthread_barrierattr_getpshared(const pthread_barrierattr_t
|
||||
* restrict</B> <I>attr</I><B>, int *restrict</B> <I>pshared</I><B>);
|
||||
<BR>int pthread_barrierattr_setpshared(pthread_barrierattr_t *</B><I>attr</I><B>,
|
||||
int</B> <I>pshared</I><B>); </B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_barrierattr_getpshared</B> function shall obtain
|
||||
the value of the <I>process-shared</I> attribute from the attributes
|
||||
object referenced by <I>attr</I>. The <B>pthread_barrierattr_setpshared</B>
|
||||
function shall set the <I>process-shared</I> attribute in an
|
||||
initialized attributes object referenced by <I>attr</I>.
|
||||
</P>
|
||||
<P>The <I>process-shared</I> attribute is set to
|
||||
PTHREAD_PROCESS_SHARED to permit a barrier to be operated upon by any
|
||||
thread that has access to the memory where the barrier is allocated.
|
||||
If the <I>process-shared</I> attribute is PTHREAD_PROCESS_PRIVATE,
|
||||
the barrier shall only be operated upon by threads created within the
|
||||
same process as the thread that initialized the barrier; if threads
|
||||
of different processes attempt to operate on such a barrier, the
|
||||
behavior is undefined. The default value of the attribute shall be
|
||||
PTHREAD_PROCESS_PRIVATE. Both constants PTHREAD_PROCESS_SHARED and
|
||||
PTHREAD_PROCESS_PRIVATE are defined in <I><pthread.h></I>.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in
|
||||
pthread.h as -1 to indicate that these routines are implemented but
|
||||
that the process shared attribute is not supported.</P>
|
||||
<P>Additional attributes, their default values, and the names of the
|
||||
associated functions to get and set those attribute values are
|
||||
implementation-defined.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>If successful, the <B>pthread_barrierattr_getpshared</B> function
|
||||
shall return zero and store the value of the <I>process-shared</I>
|
||||
attribute of <I>attr</I> into the object referenced by the <I>pshared</I>
|
||||
parameter. Otherwise, an error number shall be returned to indicate
|
||||
the error.
|
||||
</P>
|
||||
<P>If successful, the <B>pthread_barrierattr_setpshared</B> function
|
||||
shall return zero; otherwise, an error number shall be returned to
|
||||
indicate the error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>These functions may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>attr</I> is invalid.
|
||||
</DD><DT>
|
||||
The <B>pthread_barrierattr_setpshared</B> function may fail if:
|
||||
</DT><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The new value specified for the <I>process-shared</I> attribute is
|
||||
not one of the legal values <B>PTHREAD_PROCESS_SHARED</B> or
|
||||
<B>PTHREAD_PROCESS_PRIVATE</B>.
|
||||
</DD><DT>
|
||||
<B>ENOSYS</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>attr</I> was <B>PTHREAD_PROCESS_SHARED</B>
|
||||
(Pthreads-w32).</DD></DL>
|
||||
<P>
|
||||
These functions shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P>The <B>pthread_barrierattr_getpshared</B> and
|
||||
<B>pthread_barrierattr_setpshared</B> functions are part of the
|
||||
Barriers option and need not be provided on all implementations.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> and
|
||||
<B>_POSIX_THREAD_PROCESS_SHARED</B> in pthread.h as -1 to indicate
|
||||
that these routines are implemented and may be used, but do not
|
||||
support the process shared option.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_barrier_init.html"><B>pthread_barrier_destroy</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_destroy</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_barrierattr_init.html"><B>pthread_barrierattr_init</B>(3)</A>
|
||||
<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><pthread.h></I>
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,205 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_CANCEL(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;12090500">
|
||||
<META NAME="CHANGED" CONTENT="20050505;18220000">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_cancel, pthread_setcancelstate, pthread_setcanceltype,
|
||||
pthread_testcancel - thread cancellation
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_cancel(pthread_t </B><I>thread</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_setcancelstate(int </B><I>state</I><B>, int
|
||||
*</B><I>oldstate</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_setcanceltype(int </B><I>type</I><B>, int
|
||||
*</B><I>oldtype</I><B>);</B>
|
||||
</P>
|
||||
<P><B>void pthread_testcancel(void);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Cancellation is the mechanism by which a thread can terminate the
|
||||
execution of another thread. More precisely, a thread can send a
|
||||
cancellation request to another thread. Depending on its settings,
|
||||
the target thread can then either ignore the request, honor it
|
||||
immediately, or defer it until it reaches a cancellation point.
|
||||
</P>
|
||||
<P>When a thread eventually honors a cancellation request, it
|
||||
performs as if <B>pthread_exit(PTHREAD_CANCELED)</B> has been called
|
||||
at that point: all cleanup handlers are executed in reverse order,
|
||||
destructor functions for thread-specific data are called, and finally
|
||||
the thread stops executing with the return value <B>PTHREAD_CANCELED</B>.
|
||||
See <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> for more
|
||||
information.
|
||||
</P>
|
||||
<P><B>pthread_cancel</B> sends a cancellation request to the thread
|
||||
denoted by the <I>thread</I> argument.
|
||||
</P>
|
||||
<P><B>pthread_setcancelstate</B> changes the cancellation state for
|
||||
the calling thread -- that is, whether cancellation requests are
|
||||
ignored or not. The <I>state</I> argument is the new cancellation
|
||||
state: either <B>PTHREAD_CANCEL_ENABLE</B> to enable cancellation, or
|
||||
<B>PTHREAD_CANCEL_DISABLE</B> to disable cancellation (cancellation
|
||||
requests are ignored). If <I>oldstate</I> is not <B>NULL</B>, the
|
||||
previous cancellation state is stored in the location pointed to by
|
||||
<I>oldstate</I>, and can thus be restored later by another call to
|
||||
<B>pthread_setcancelstate</B>.
|
||||
</P>
|
||||
<P><B>pthread_setcanceltype</B> changes the type of responses to
|
||||
cancellation requests for the calling thread: asynchronous
|
||||
(immediate) or deferred. The <I>type</I> argument is the new
|
||||
cancellation type: either <B>PTHREAD_CANCEL_ASYNCHRONOUS</B> to
|
||||
cancel the calling thread as soon as the cancellation request is
|
||||
received, or <B>PTHREAD_CANCEL_DEFERRED</B> to keep the cancellation
|
||||
request pending until the next cancellation point. If <I>oldtype</I>
|
||||
is not <B>NULL</B>, the previous cancellation state is stored in the
|
||||
location pointed to by <I>oldtype</I>, and can thus be restored later
|
||||
by another call to <B>pthread_setcanceltype</B>.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> provides two levels of support for
|
||||
<B>PTHREAD_CANCEL_ASYNCHRONOUS</B>: full and partial. Full support
|
||||
requires an additional DLL and driver be installed on the Windows
|
||||
system (see the See Also section below) that allows blocked threads
|
||||
to be cancelled immediately. Partial support means that the target
|
||||
thread will not cancel until it resumes execution naturally. Partial
|
||||
support is provided if either the DLL or the driver are not
|
||||
automatically detected by the pthreads-w32 library at run-time.</P>
|
||||
<P>Threads are always created by <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A>
|
||||
with cancellation enabled and deferred. That is, the initial
|
||||
cancellation state is <B>PTHREAD_CANCEL_ENABLE</B> and the initial
|
||||
type is <B>PTHREAD_CANCEL_DEFERRED</B>.
|
||||
</P>
|
||||
<P>Cancellation points are those points in the program execution
|
||||
where a test for pending cancellation requests is performed and
|
||||
cancellation is executed if positive. The following POSIX threads
|
||||
functions are cancellation points:
|
||||
</P>
|
||||
<P><A HREF="pthread_join.html"><B>pthread_join</B>(3)</A>
|
||||
<BR><A HREF="pthread_cond_init.html"><B>pthread_cond_wait</B>(3)</A>
|
||||
<BR><A HREF="pthread_cond_init.html"><B>pthread_cond_timedwait</B>(3)</A>
|
||||
<BR><A HREF=""><B>pthread_testcancel</B>(3)</A> <BR><A HREF="sem_init.html"><B>sem_wait</B>(3)</A>
|
||||
<BR><A HREF="sem_init.html"><B>sem_timedwait</B>(3)</A> <BR><A HREF="pthread_kill.html"><B>sigwait</B>(3)</A></P>
|
||||
<P><B>Pthreads-w32</B> provides two functions to enable additional
|
||||
cancellation points to be created in user functions that block on
|
||||
Win32 HANDLEs:</P>
|
||||
<P><A HREF="pthreadCancelableWait.html">pthreadCancelableWait()</A>
|
||||
<BR><A HREF="pthreadCancelableTimedWait.html">pthreadCancelableTimedWait()</A></P>
|
||||
<P>All other POSIX threads functions are guaranteed not to be
|
||||
cancellation points. That is, they never perform cancellation in
|
||||
deferred cancellation mode.
|
||||
</P>
|
||||
<P><B>pthread_testcancel</B> does nothing except testing for pending
|
||||
cancellation and executing it. Its purpose is to introduce explicit
|
||||
checks for cancellation in long sequences of code that do not call
|
||||
cancellation point functions otherwise.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P><B>pthread_cancel</B>, <B>pthread_setcancelstate</B> and
|
||||
<B>pthread_setcanceltype</B> return 0 on success and a non-zero error
|
||||
code on error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P><B>pthread_cancel</B> returns the following error code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ESRCH</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
no thread could be found corresponding to that specified by the
|
||||
<I>thread</I> ID.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
<B>pthread_setcancelstate</B> returns the following error code on
|
||||
error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the <I>state</I> argument is not
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE>
|
||||
<B>PTHREAD_CANCEL_ENABLE</B> nor <B>PTHREAD_CANCEL_DISABLE</B>
|
||||
</BLOCKQUOTE>
|
||||
<P><B>pthread_setcanceltype</B> returns the following error code on
|
||||
error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the <I>type</I> argument is not
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE>
|
||||
<B>PTHREAD_CANCEL_DEFERRED</B> nor <B>PTHREAD_CANCEL_ASYNCHRONOUS</B>
|
||||
</BLOCKQUOTE>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
|
||||
<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> ,
|
||||
<A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B>(3)</A>
|
||||
, <A HREF="pthread_cleanup_pop.html"><B>pthread_cleanup_pop</B>(3)</A>
|
||||
, Pthreads-w32 package README file 'Prerequisites' section.
|
||||
</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Bugs</A></H2>
|
||||
<P>POSIX specifies that a number of system calls (basically, all
|
||||
system calls that may block, such as <A HREF="read.html"><B>read</B>(2)</A>
|
||||
, <A HREF="write.html"><B>write</B>(2)</A> , <A HREF="wait.html"><B>wait</B>(2)</A>
|
||||
, etc.) and library functions that may call these system calls (e.g.
|
||||
<A HREF="fprintf.html"><B>fprintf</B>(3)</A> ) are cancellation
|
||||
points. <B>Pthreads-win32</B> is not integrated enough with the C
|
||||
library to implement this, and thus none of the C library functions
|
||||
is a cancellation point.
|
||||
</P>
|
||||
<P>A workaround for these calls is to temporarily switch to
|
||||
asynchronous cancellation (assuming full asynchronous cancellation
|
||||
support is installed). So, checking for cancellation during a <B>read</B>
|
||||
system call, for instance, can be achieved as follows:
|
||||
</P>
|
||||
<BLOCKQUOTE><BR><BR>
|
||||
</BLOCKQUOTE>
|
||||
<PRE STYLE="margin-left: 1cm; margin-right: 1cm">pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldCancelType);
|
||||
read(fd, buffer, length);
|
||||
pthread_setcanceltype(oldCancelType, NULL);</PRE>
|
||||
<HR>
|
||||
<BLOCKQUOTE><A NAME="toc"></A><B>Table of Contents</B></BLOCKQUOTE>
|
||||
<UL>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See
|
||||
Also</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE><A HREF="#sect7" NAME="toc7">Bugs</A>
|
||||
</BLOCKQUOTE>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,140 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_CLEANUP(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;20152200">
|
||||
<META NAME="CHANGED" CONTENT="20050505;18252600">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_cleanup_push, pthread_cleanup_pop - install and remove
|
||||
cleanup handlers
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>void pthread_cleanup_push(void (*</B><I>routine</I><B>) (void
|
||||
*), void *</B><I>arg</I><B>);</B>
|
||||
</P>
|
||||
<P><B>void pthread_cleanup_pop(int </B><I>execute</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Cleanup handlers are functions that get called when a thread
|
||||
terminates, either by calling <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A>
|
||||
or because of cancellation. Cleanup handlers are installed and
|
||||
removed following a stack-like discipline.
|
||||
</P>
|
||||
<P>The purpose of cleanup handlers is to free the resources that a
|
||||
thread may hold at the time it terminates. In particular, if a thread
|
||||
exits or is cancelled while it owns a locked mutex, the mutex will
|
||||
remain locked forever and prevent other threads from executing
|
||||
normally. The best way to avoid this is, just before locking the
|
||||
mutex, to install a cleanup handler whose effect is to unlock the
|
||||
mutex. Cleanup handlers can be used similarly to free blocks
|
||||
allocated with <A HREF="malloc.html"><B>malloc</B>(3)</A> or close
|
||||
file descriptors on thread termination.
|
||||
</P>
|
||||
<P><B>pthread_cleanup_push</B> installs the <I>routine</I> function
|
||||
with argument <I>arg</I> as a cleanup handler. From this point on to
|
||||
the matching <B>pthread_cleanup_pop</B>, the function <I>routine</I>
|
||||
will be called with arguments <I>arg</I> when the thread terminates,
|
||||
either through <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A>
|
||||
or by cancellation. If several cleanup handlers are active at that
|
||||
point, they are called in LIFO order: the most recently installed
|
||||
handler is called first.
|
||||
</P>
|
||||
<P><B>pthread_cleanup_pop</B> removes the most recently installed
|
||||
cleanup handler. If the <I>execute</I> argument is not 0, it also
|
||||
executes the handler, by calling the <I>routine</I> function with
|
||||
arguments <I>arg</I>. If the <I>execute</I> argument is 0, the
|
||||
handler is only removed but not executed.
|
||||
</P>
|
||||
<P>Matching pairs of <B>pthread_cleanup_push</B> and
|
||||
<B>pthread_cleanup_pop</B> must occur in the same function, at the
|
||||
same level of block nesting. Actually, <B>pthread_cleanup_push</B>
|
||||
and <B>pthread_cleanup_pop</B> are macros, and the expansion of
|
||||
<B>pthread_cleanup_push</B> introduces an open brace <B>{</B> with
|
||||
the matching closing brace <B>}</B> being introduced by the expansion
|
||||
of the matching <B>pthread_cleanup_pop</B>.
|
||||
</P>
|
||||
<H2 STYLE="margin-top: 0cm"><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">None.
|
||||
</BLOCKQUOTE>
|
||||
<H2 STYLE="margin-top: 0cm"><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">None.
|
||||
</BLOCKQUOTE>
|
||||
<H2 STYLE="margin-top: 0cm"><A HREF="#toc5" NAME="sect5">Author</A></H2>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">Xavier Leroy
|
||||
<Xavier.Leroy@inria.fr>
|
||||
</BLOCKQUOTE>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">Modified by
|
||||
Ross Johnson for use with Pthreads-w32.</BLOCKQUOTE>
|
||||
<H2 STYLE="margin-top: 0cm"><A HREF="#toc6" NAME="sect6">See Also</A></H2>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A>
|
||||
, <A HREF="pthread_cancel.html"><B>pthread_cancel</B>(3)</A> ,
|
||||
<A HREF="pthread_cancel.html"><B>pthread_setcanceltype</B>(3)</A> .
|
||||
</BLOCKQUOTE>
|
||||
<H2 STYLE="margin-top: 0cm"><A HREF="#toc7" NAME="sect7">Example</A></H2>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">Here is how
|
||||
to lock a mutex <I>mut</I> in such a way that it will be unlocked if
|
||||
the thread is canceled while <I>mut</I> is locked:
|
||||
</BLOCKQUOTE>
|
||||
<PRE>pthread_cleanup_push(pthread_mutex_unlock, (void *) &mut);
|
||||
pthread_mutex_lock(&mut);
|
||||
/* do some work */
|
||||
pthread_mutex_unlock(&mut);
|
||||
pthread_cleanup_pop(0);</PRE><BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">
|
||||
Equivalently, the last two lines can be replaced by
|
||||
</BLOCKQUOTE>
|
||||
<PRE STYLE="margin-bottom: 0.5cm">pthread_cleanup_pop(1);</PRE><BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">
|
||||
Notice that the code above is safe only in deferred cancellation mode
|
||||
(see <A HREF="pthread_cancel.html"><B>pthread_setcanceltype</B>(3)</A>
|
||||
). In asynchronous cancellation mode, a cancellation can occur
|
||||
between <B>pthread_cleanup_push</B> and <B>pthread_mutex_lock</B>, or
|
||||
between <B>pthread_mutex_unlock</B> and <B>pthread_cleanup_pop</B>,
|
||||
resulting in both cases in the thread trying to unlock a mutex not
|
||||
locked by the current thread. This is the main reason why
|
||||
asynchronous cancellation is difficult to use.
|
||||
</BLOCKQUOTE>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm">If the code
|
||||
above must also work in asynchronous cancellation mode, then it must
|
||||
switch to deferred mode for locking and unlocking the mutex:
|
||||
</BLOCKQUOTE>
|
||||
<PRE>pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
|
||||
pthread_cleanup_push(pthread_mutex_unlock, (void *) &mut);
|
||||
pthread_mutex_lock(&mut);
|
||||
/* do some work */
|
||||
pthread_cleanup_pop(1);
|
||||
pthread_setcanceltype(oldtype, NULL);</PRE>
|
||||
<HR>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A NAME="toc"></A>
|
||||
<B>Table of Contents</B></BLOCKQUOTE>
|
||||
<UL>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See
|
||||
Also</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm"><A HREF="#sect7" NAME="toc7">Example</A>
|
||||
</BLOCKQUOTE>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,313 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_COND(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;16454400">
|
||||
<META NAME="CHANGED" CONTENT="20050505;19004700">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_cond_init, pthread_cond_destroy, pthread_cond_signal,
|
||||
pthread_cond_broadcast, pthread_cond_wait, pthread_cond_timedwait -
|
||||
operations on conditions
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>pthread_cond_t </B><I>cond</I> <B>= PTHREAD_COND_INITIALIZER;</B>
|
||||
</P>
|
||||
<P><B>int pthread_cond_init(pthread_cond_t *</B><I>cond</I><B>,
|
||||
pthread_condattr_t *</B><I>cond_attr</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_cond_signal(pthread_cond_t *</B><I>cond</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_cond_broadcast(pthread_cond_t *</B><I>cond</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_cond_wait(pthread_cond_t *</B><I>cond</I><B>,
|
||||
pthread_mutex_t *</B><I>mutex</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_cond_timedwait(pthread_cond_t *</B><I>cond</I><B>,
|
||||
pthread_mutex_t *</B><I>mutex</I><B>, const struct timespec
|
||||
*</B><I>abstime</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_cond_destroy(pthread_cond_t *</B><I>cond</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>A condition (short for ‘‘condition variable’’) is a
|
||||
synchronization device that allows threads to suspend execution and
|
||||
relinquish the processors until some predicate on shared data is
|
||||
satisfied. The basic operations on conditions are: signal the
|
||||
condition (when the predicate becomes true), and wait for the
|
||||
condition, suspending the thread execution until another thread
|
||||
signals the condition.
|
||||
</P>
|
||||
<P>A condition variable must always be associated with a mutex, to
|
||||
avoid the race condition where a thread prepares to wait on a
|
||||
condition variable and another thread signals the condition just
|
||||
before the first thread actually waits on it.
|
||||
</P>
|
||||
<P><B>pthread_cond_init</B> initializes the condition variable <I>cond</I>,
|
||||
using the condition attributes specified in <I>cond_attr</I>, or
|
||||
default attributes if <I>cond_attr</I> is <B>NULL</B>.
|
||||
</P>
|
||||
<P>Variables of type <B>pthread_cond_t</B> can also be initialized
|
||||
statically, using the constant <B>PTHREAD_COND_INITIALIZER</B>. In
|
||||
the <B>Pthreads-w32</B> implementation, an application should still
|
||||
call <B>pthread_cond_destroy</B> at some point to ensure that any
|
||||
resources consumed by the condition variable are released.</P>
|
||||
<P><B>pthread_cond_signal</B> restarts one of the threads that are
|
||||
waiting on the condition variable <I>cond</I>. If no threads are
|
||||
waiting on <I>cond</I>, nothing happens. If several threads are
|
||||
waiting on <I>cond</I>, exactly one is restarted, but it is not
|
||||
specified which.
|
||||
</P>
|
||||
<P><B>pthread_cond_broadcast</B> restarts all the threads that are
|
||||
waiting on the condition variable <I>cond</I>. Nothing happens if no
|
||||
threads are waiting on <I>cond</I>.
|
||||
</P>
|
||||
<P><B>pthread_cond_wait</B> atomically unlocks the <I>mutex</I> (as
|
||||
per <B>pthread_unlock_mutex</B>) and waits for the condition variable
|
||||
<I>cond</I> to be signalled. The thread execution is suspended and
|
||||
does not consume any CPU time until the condition variable is
|
||||
signalled. The <I>mutex</I> must be locked by the calling thread on
|
||||
entrance to <B>pthread_cond_wait</B>. Before returning to the calling
|
||||
thread, <B>pthread_cond_wait</B> re-acquires <I>mutex</I> (as per
|
||||
<B>pthread_lock_mutex</B>).
|
||||
</P>
|
||||
<P>Unlocking the mutex and suspending on the condition variable is
|
||||
done atomically. Thus, if all threads always acquire the mutex before
|
||||
signalling the condition, this guarantees that the condition cannot
|
||||
be signalled (and thus ignored) between the time a thread locks the
|
||||
mutex and the time it waits on the condition variable.
|
||||
</P>
|
||||
<P><B>pthread_cond_timedwait</B> atomically unlocks <I>mutex</I> and
|
||||
waits on <I>cond</I>, as <B>pthread_cond_wait</B> does, but it also
|
||||
bounds the duration of the wait. If <I>cond</I> has not been
|
||||
signalled within the amount of time specified by <I>abstime</I>, the
|
||||
mutex <I>mutex</I> is re-acquired and <B>pthread_cond_timedwait</B>
|
||||
returns the error <B>ETIMEDOUT</B>. The <I>abstime</I> parameter
|
||||
specifies an absolute time, with the same origin as <A HREF="time.html"><B>time</B>(2)</A>
|
||||
and <A HREF="gettimeofday.html"><B>gettimeofday</B>(2)</A>.
|
||||
</P>
|
||||
<P><B>pthread_cond_destroy</B> destroys a condition variable, freeing
|
||||
the resources it might hold. No threads must be waiting on the
|
||||
condition variable on entrance to <B>pthread_cond_destroy</B>.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P><B>pthread_cond_wait</B> and <B>pthread_cond_timedwait</B> are
|
||||
cancellation points. If a thread is cancelled while suspended in one
|
||||
of these functions, the thread immediately resumes execution, then
|
||||
locks again the <I>mutex</I> argument to <B>pthread_cond_wait</B> and
|
||||
<B>pthread_cond_timedwait</B>, and finally executes the cancellation.
|
||||
Consequently, cleanup handlers are assured that <I>mutex</I> is
|
||||
locked when they are called.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Async-signal Safety</A></H2>
|
||||
<P>The condition functions are not async-signal safe, and should not
|
||||
be called from a signal handler. In particular, calling
|
||||
<B>pthread_cond_signal</B> or <B>pthread_cond_broadcast</B> from a
|
||||
signal handler may deadlock the calling thread.
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Return Value</A></H2>
|
||||
<P>All condition variable functions return 0 on success and a
|
||||
non-zero error code on error.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Errors</A></H2>
|
||||
<P><B>pthread_cond_init</B>, <B>pthread_cond_signal</B>,
|
||||
<B>pthread_cond_broadcast</B>, and <B>pthread_cond_wait</B> never
|
||||
return an error code.
|
||||
</P>
|
||||
<P>The <B>pthread_cond_init</B> function returns the following error
|
||||
codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The <I>cond</I> argument is invalid.
|
||||
</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<B>ENOMEM</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE STYLE="margin-left: 4cm">
|
||||
There was not enough memory to allocate the condition variable.
|
||||
</BLOCKQUOTE>
|
||||
<P>The <B>pthread_cond_signal</B> function returns the following
|
||||
error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The <I>cond</I> argument is invalid.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_cond_broadcast</B> function returns the following
|
||||
error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The <I>cond</I> argument is invalid.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_cond_wait</B> function returns the following error
|
||||
codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The <I>cond</I> argument is invalid.
|
||||
</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<B>ENOMEM</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE STYLE="margin-left: 4cm">
|
||||
There was not enough memory to allocate the statically initialised
|
||||
condition variable. Statically initialised condition variables are
|
||||
dynamically allocated by the first thread to wait on them.</BLOCKQUOTE>
|
||||
<P>The <B>pthread_cond_timedwait</B> function returns the following
|
||||
error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<P STYLE="margin-left: 2cm">
|
||||
The <I>cond</I> argument is invalid.
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ETIMEDOUT</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The condition variable was not signalled before the timeout
|
||||
specified by <I>abstime</I>
|
||||
</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<B>ENOMEM</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE STYLE="margin-left: 4cm">
|
||||
There was not enough memory to allocate the statically initialised
|
||||
condition variable. Statically initialised condition variables are
|
||||
dynamically allocated by the first thread to wait on them.
|
||||
</BLOCKQUOTE>
|
||||
<P>The <B>pthread_cond_destroy</B> function returns the following
|
||||
error code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<P STYLE="margin-left: 2cm; margin-right: 1cm">
|
||||
The <I>cond</I> argument is invalid.
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EBUSY</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
Some threads are currently waiting on <I>cond</I>.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<H2>
|
||||
<A HREF="#toc7" NAME="sect7">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">See Also</A></H2>
|
||||
<P><A HREF="pthread_condattr_init.html"><B>pthread_condattr_init</B>(3)</A>
|
||||
, <A HREF="pthread_mutex_lock.html"><B>pthread_mutex_lock</B>(3)</A>
|
||||
, <A HREF="pthread_mutex_unlock.html"><B>pthread_mutex_unlock</B>(3)</A>
|
||||
, <A HREF="pthread_cancel.html"><B>pthread_cancel(3)</B></A>.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">Example</A></H2>
|
||||
<P>Consider two shared variables <I>x</I> and <I>y</I>, protected by
|
||||
the mutex <I>mut</I>, and a condition variable <I>cond</I> that is to
|
||||
be signaled whenever <I>x</I> becomes greater than <I>y</I>.
|
||||
</P>
|
||||
<PRE STYLE="margin-left: 1cm; margin-right: 1cm">int x,y;
|
||||
pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;</PRE><BLOCKQUOTE>
|
||||
Waiting until <I>x</I> is greater than <I>y</I> is performed as
|
||||
follows:
|
||||
</BLOCKQUOTE>
|
||||
<PRE STYLE="margin-left: 1.01cm">pthread_mutex_lock(&mut);
|
||||
while (x <= y) {
|
||||
pthread_cond_wait(&cond, &mut);
|
||||
}
|
||||
/* operate on x and y */
|
||||
pthread_mutex_unlock(&mut);</PRE><BLOCKQUOTE STYLE="margin-left: 3.01cm">
|
||||
Modifications on <I>x</I> and <I>y</I> that may cause <I>x</I> to
|
||||
become greater than <I>y</I> should signal the condition if needed:
|
||||
</BLOCKQUOTE>
|
||||
<PRE STYLE="margin-left: 1.01cm">pthread_mutex_lock(&mut);
|
||||
/* modify x and y */
|
||||
if (x > y) pthread_cond_broadcast(&cond);
|
||||
pthread_mutex_unlock(&mut);</PRE><BLOCKQUOTE STYLE="margin-left: 3.01cm">
|
||||
If it can be proved that at most one waiting thread needs to be waken
|
||||
up (for instance, if there are only two threads communicating through
|
||||
<I>x</I> and <I>y</I>), <B>pthread_cond_signal</B> can be used as a
|
||||
slightly more efficient alternative to <B>pthread_cond_broadcast</B>.
|
||||
If in doubt, use <B>pthread_cond_broadcast</B>.
|
||||
</BLOCKQUOTE>
|
||||
<BLOCKQUOTE STYLE="margin-left: 3.01cm">To wait for <I>x</I> to
|
||||
become greater than <I>y</I> with a timeout of 5 seconds, do:
|
||||
</BLOCKQUOTE>
|
||||
<PRE STYLE="margin-left: 1.01cm">struct timeval now;
|
||||
struct timespec timeout;
|
||||
int retcode;
|
||||
pthread_mutex_lock(&mut);
|
||||
gettimeofday(&now);
|
||||
timeout.tv_sec = now.tv_sec + 5;
|
||||
timeout.tv_nsec = now.tv_usec * 1000;
|
||||
retcode = 0;
|
||||
while (x <= y && retcode != ETIMEDOUT) {
|
||||
retcode = pthread_cond_timedwait(&cond, &mut, &timeout);
|
||||
}
|
||||
if (retcode == ETIMEDOUT) {
|
||||
/* timeout occurred */
|
||||
} else {
|
||||
/* operate on x and y */
|
||||
}
|
||||
pthread_mutex_unlock(&mut);</PRE>
|
||||
<HR>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A NAME="toc"></A>
|
||||
<B>Table of Contents</B></BLOCKQUOTE>
|
||||
<UL>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Async-signal
|
||||
Safety</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Return
|
||||
Value</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Errors</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Author</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm; margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">See
|
||||
Also</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 0cm"><A HREF="#sect9" NAME="toc9">Example</A>
|
||||
</BLOCKQUOTE>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,98 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_CONDATTR(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;16375600">
|
||||
<META NAME="CHANGED" CONTENT="20050504;16570300">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_condattr_init, pthread_condattr_destroy - condition
|
||||
creation
|
||||
</P>
|
||||
<P>attributes
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_condattr_init(pthread_condattr_t *</B><I>attr</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_condattr_destroy(pthread_condattr_t *</B><I>attr</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Condition attributes can be specified at condition creation time,
|
||||
by passing a condition attribute object as second argument to
|
||||
<A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> .
|
||||
Passing <B>NULL</B> is equivalent to passing a condition attribute
|
||||
object with all attributes set to their default values.
|
||||
</P>
|
||||
<P><B>pthread_condattr_init</B> initializes the condition attribute
|
||||
object <I>attr</I> and fills it with default values for the
|
||||
attributes. <B>pthread_condattr_destroy</B> destroys a condition
|
||||
attribute object, which must not be reused until it is reinitialized.</P>
|
||||
<P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in
|
||||
pthread.h as -1 to indicate that the attribute routines are
|
||||
implemented but that the process shared attribute is not supported.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>All condition variable functions return 0 on success and a
|
||||
non-zero error code on error.</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_condattr_init</B> function returns the following
|
||||
error code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOMEM</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The was insufficient memory to create the attribute.<SPAN STYLE="font-weight: medium">
|
||||
</SPAN>
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_condattr_destroy</B> function returns the following
|
||||
error code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
The <I>attr</I> argument is not valid.<SPAN STYLE="font-weight: medium">
|
||||
</SPAN>
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<H2>
|
||||
<A HREF="#toc5" NAME="sect5">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
|
||||
<P><A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> .
|
||||
</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect6" NAME="toc6">See Also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,153 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>"PTHREAD_CONDATTR_GETPSHARED"(P) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;17542300">
|
||||
<META NAME="CHANGED" CONTENT="20050505;18293100">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_condattr_getpshared, pthread_condattr_setpshared - get and
|
||||
set the process-shared condition variable attributes
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h> </B>
|
||||
</P>
|
||||
<P><B>int pthread_condattr_getpshared(const pthread_condattr_t
|
||||
*restrict</B> <I>attr</I><B>, int *restrict</B> <I>pshared</I><B>);
|
||||
<BR>int pthread_condattr_setpshared(pthread_condattr_t *</B><I>attr</I><B>,
|
||||
int</B> <I>pshared</I><B>); </B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>The <B>pthread_condattr_getpshared</B> function shall obtain the
|
||||
value of the <I>process-shared</I> attribute from the attributes
|
||||
object referenced by <I>attr</I>. The <B>pthread_condattr_setpshared</B>
|
||||
function shall set the <I>process-shared</I> attribute in an
|
||||
initialized attributes object referenced by <I>attr</I>.
|
||||
</P>
|
||||
<P>The <I>process-shared</I> attribute is set to
|
||||
<B>PTHREAD_PROCESS_SHARED</B> to permit a condition variable to be
|
||||
operated upon by any thread that has access to the memory where the
|
||||
condition variable is allocated, even if the condition variable is
|
||||
allocated in memory that is shared by multiple processes. If the
|
||||
<I>process-shared</I> attribute is <B>PTHREAD_PROCESS_PRIVATE</B>,
|
||||
the condition variable shall only be operated upon by threads created
|
||||
within the same process as the thread that initialized the condition
|
||||
variable; if threads of differing processes attempt to operate on
|
||||
such a condition variable, the behavior is undefined. The default
|
||||
value of the attribute is <B>PTHREAD_PROCESS_PRIVATE</B>.
|
||||
</P>
|
||||
<P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in
|
||||
pthread.h as -1 to indicate that these routines are implemented but
|
||||
that the process shared attribute is not supported.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>If successful, the <B>pthread_condattr_setpshared</B> function
|
||||
shall return zero; otherwise, an error number shall be returned to
|
||||
indicate the error.
|
||||
</P>
|
||||
<P>If successful, the <B>pthread_condattr_getpshared</B> function
|
||||
shall return zero and store the value of the <I>process-shared</I>
|
||||
attribute of <I>attr</I> into the object referenced by the <I>pshared</I>
|
||||
parameter. Otherwise, an error number shall be returned to indicate
|
||||
the error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P>The <B>pthread_condattr_getpshared</B> and
|
||||
<B>pthread_condattr_setpshared</B> functions may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>attr</I> is invalid.
|
||||
</DD></DL>
|
||||
<P>
|
||||
The <B>pthread_condattr_setpshared</B> function may fail if:
|
||||
</P>
|
||||
<DL>
|
||||
<DT><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The new value specified for the attribute is outside the range of
|
||||
legal values for that attribute.
|
||||
</DD><DT>
|
||||
<B>ENOSYS</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The value specified by <I>attr</I> was <B>PTHREAD_PROCESS_SHARED</B>
|
||||
(Pthreads-w32).</DD></DL>
|
||||
<P>
|
||||
These functions shall not return an error code of [EINTR].
|
||||
</P>
|
||||
<P><I>The following sections are informative.</I>
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
|
||||
<P><B>Pthreads-w32</B> defines <B>_POSIX_THREAD_PROCESS_SHARED</B> in
|
||||
pthread.h as -1 to indicate that these routines are implemented and
|
||||
may be used, but do not support the process shared option.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
|
||||
<P>None.
|
||||
</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
|
||||
<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> <B>,</B>
|
||||
<A HREF="pthread_cond_init.html"><B>pthread_cond_destroy</B>(3)</A> <B>,</B>
|
||||
<A HREF="pthread_condattr_init.html"><B>pthread_condattr_destroy</B>(3)</A>
|
||||
<B>,</B> <A HREF="pthread_mutex_init.html"><B>pthread_mutex_destroy</B>(3)</A>
|
||||
<B>,</B> the Base Definitions volume of IEEE Std 1003.1-2001,
|
||||
<I><pthread.h></I>
|
||||
</P>
|
||||
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
|
||||
<P>Portions of this text are reprinted and reproduced in electronic
|
||||
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
|
||||
Technology -- Portable Operating System Interface (POSIX), The Open
|
||||
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
|
||||
Institute of Electrical and Electronics Engineers, Inc and The Open
|
||||
Group. In the event of any discrepancy between this version and the
|
||||
original IEEE and The Open Group Standard, the original IEEE and The
|
||||
Open Group Standard is the referee document. The original Standard
|
||||
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
|
||||
.
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
|
||||
Usage</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
|
||||
Directions</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_CREATE(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;19394700">
|
||||
<META NAME="CHANGED" CONTENT="20050504;20140200">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_create - create a new thread
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_create(pthread_t * </B><I>thread</I><B>,
|
||||
pthread_attr_t * </B><I>attr</I><B>, void * (*</B><I>start_routine</I><B>)(void
|
||||
*), void * </B><I>arg</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P><B>pthread_create</B> creates a new thread of control that
|
||||
executes concurrently with the calling thread. The new thread applies
|
||||
the function <I>start_routine</I> passing it <I>arg</I> as first
|
||||
argument. The new thread terminates either explicitly, by calling
|
||||
<A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , or
|
||||
implicitly, by returning from the <I>start_routine</I> function. The
|
||||
latter case is equivalent to calling <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A>
|
||||
with the result returned by <I>start_routine</I> as exit code.
|
||||
</P>
|
||||
<P>The initial signal state of the new thread is inherited from it's
|
||||
creating thread and there are no pending signals. <B>Pthreads-w32</B>
|
||||
does not yet implement signals.</P>
|
||||
<P>The <I>attr</I> argument specifies thread attributes to be applied
|
||||
to the new thread. See <A HREF="pthread_attr_init.html"><B>pthread_attr_init</B>(3)</A>
|
||||
for a complete list of thread attributes. The <I>attr</I> argument
|
||||
can also be <B>NULL</B>, in which case default attributes are used:
|
||||
the created thread is joinable (not detached) and has default (non
|
||||
real-time) scheduling policy.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>On success, the identifier of the newly created thread is stored
|
||||
in the location pointed by the <I>thread</I> argument, and a 0 is
|
||||
returned. On error, a non-zero error code is returned.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<DL>
|
||||
<DT><B>EAGAIN</B>
|
||||
</DT><DL>
|
||||
<DL>
|
||||
<DT>
|
||||
Not enough system resources to create a process for the new
|
||||
thread, or<BR>more than <B>PTHREAD_THREADS_MAX</B> threads are
|
||||
already active.
|
||||
</DT></DL>
|
||||
</DL>
|
||||
</DL>
|
||||
<H2>
|
||||
<A HREF="#toc5" NAME="sect5">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
|
||||
<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> ,
|
||||
<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> ,
|
||||
<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> ,
|
||||
<A HREF="pthread_attr_init.html"><B>pthread_attr_init</B>(3)</A> .
|
||||
</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect6" NAME="toc6">See Also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_DELAY_NP manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050505;322600">
|
||||
<META NAME="CHANGED" CONTENT="20050505;21371500">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P STYLE="font-weight: medium">pthread_delay_np – suspend the
|
||||
thread for a specified period</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_delay_np (const struct timespec *</B>interval<B>);</B></P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P><B>pthread_delay_np</B> causes a thread to delay execution for a
|
||||
specific period of time. This period ends at the current time plus
|
||||
the specified interval. The routine will not return before the end of
|
||||
the period is reached, but may return an arbitrary amount of time
|
||||
after the period has gone by. This can be due to system load, thread
|
||||
priorities, and system timer granularity.</P>
|
||||
<P>Specifying an interval of zero (0) seconds and zero (0)
|
||||
nanoseconds is allowed and can be used to force the thread to give up
|
||||
the processor or to deliver a pending cancellation request.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P><B>pthread_delay_np </B>is a cancellation point.</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
|
||||
<P>If an error condition occurs, <B>pthread_delay_np</B> returns an
|
||||
integer value indicating the type of error.</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
|
||||
<P>The <B>pthread_delay_np</B> function returns the following error
|
||||
code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<P STYLE="margin-left: 2cm">
|
||||
The value specified by interval is invalid.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Author</A></H2>
|
||||
<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect6" NAME="toc6">Author</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_DETACH(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;18010700">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGED" CONTENT="20060408;9255600">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_detach - put a running thread in the detached state
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_detach(pthread_t </B><I>th</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P><B>pthread_detach</B> puts the thread <I>th</I> in the detached
|
||||
state. This guarantees that the resources consumed by <I>th</I> will
|
||||
be freed immediately when <I>th</I> terminates. However, this
|
||||
prevents other threads from synchronizing on the termination of <I>th</I>
|
||||
using <B>pthread_join</B>. If, when <B>pthread_detach</B> is called,
|
||||
<I>th</I> has already terminated, all of <I>th</I>'s remaining
|
||||
resources will be freed.</P>
|
||||
<P>A thread can be created initially in the detached state, using the
|
||||
<B>detachstate</B> attribute to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A>
|
||||
. In contrast, <B>pthread_detach</B> applies to threads created in
|
||||
the joinable state, and which need to be put in the detached state
|
||||
later.
|
||||
</P>
|
||||
<P>After <B>pthread_detach</B> completes, subsequent attempts to
|
||||
perform <B>pthread_join</B> on <I>th</I> will fail. If another thread
|
||||
is already joining the thread <I>th</I> at the time <B>pthread_detach</B>
|
||||
is called, <I>th</I> will be detached and <B>pthread_join</B> will
|
||||
eventually return when <I>th</I> terminates but may not return with
|
||||
<I>th</I>'s correct return code.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P>On success, 0 is returned. On error, a non-zero error code is
|
||||
returned.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<DL>
|
||||
<DT><B>ESRCH</B>
|
||||
</DT><DD>
|
||||
No thread could be found corresponding to that specified by <I>th</I>
|
||||
</DD><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
the thread <I>th</I> is already in the detached state
|
||||
</DD></DL>
|
||||
<H2>
|
||||
<A HREF="#toc5" NAME="sect5">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with Pthreads-w32.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
|
||||
<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> ,
|
||||
<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> ,
|
||||
<A HREF="pthread_attr_init.html"><B>pthread_attr_setdetachstate</B>(3)</A>
|
||||
</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect6" NAME="toc6">See Also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,48 @@
|
|||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>PTHREAD_EQUAL(3) manual page</title>
|
||||
</head>
|
||||
<body bgcolor='white'>
|
||||
<a href='#toc'>Table of Contents</a><p>
|
||||
|
||||
<p>
|
||||
<h2><a name='sect0' href='#toc0'>Name</a></h2>
|
||||
pthread_equal - compare two thread identifiers
|
||||
<p>
|
||||
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
|
||||
<b>#include <pthread.h></b>
|
||||
|
||||
<p> <b>int pthread_equal(pthread_t </b><i>thread1</i><b>, pthread_t </b><i>thread2</i><b>);</b>
|
||||
<p>
|
||||
<h2><a name='sect2' href='#toc2'>Description</a></h2>
|
||||
<b>pthread_equal</b>
|
||||
determines if two thread identifiers refer to the same thread.
|
||||
<p>
|
||||
<h2><a name='sect3' href='#toc3'>Return Value</a></h2>
|
||||
A
|
||||
non-zero value is returned if <i>thread1</i> and <i>thread2</i> refer to the same thread.
|
||||
Otherwise, 0 is returned.
|
||||
<p>
|
||||
<h2><a name='sect4' href='#toc4'>Author</a></h2>
|
||||
Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
<p>
|
||||
<h2><a name='sect5' href='#toc5'>See Also</a></h2>
|
||||
<a href='file:pthread_self.html'><b>pthread_self</b>(3)</a>
|
||||
.
|
||||
<p>
|
||||
|
||||
<hr><p>
|
||||
<a name='toc'><b>Table of Contents</b></a><p>
|
||||
<ul>
|
||||
<li><a name='toc0' href='#sect0'>Name</a></li>
|
||||
<li><a name='toc1' href='#sect1'>Synopsis</a></li>
|
||||
<li><a name='toc2' href='#sect2'>Description</a></li>
|
||||
<li><a name='toc3' href='#sect3'>Return Value</a></li>
|
||||
<li><a name='toc4' href='#sect4'>Author</a></li>
|
||||
<li><a name='toc5' href='#sect5'>See Also</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,59 @@
|
|||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>PTHREAD_EXIT(3) manual page</title>
|
||||
</head>
|
||||
<body bgcolor='white'>
|
||||
<a href='#toc'>Table of Contents</a><p>
|
||||
|
||||
<p>
|
||||
<h2><a name='sect0' href='#toc0'>Name</a></h2>
|
||||
pthread_exit - terminate the calling thread
|
||||
<p>
|
||||
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
|
||||
<b>#include <pthread.h></b>
|
||||
|
||||
<p> <b>void pthread_exit(void *</b><i>retval</i><b>);</b>
|
||||
<p>
|
||||
<h2><a name='sect2' href='#toc2'>Description</a></h2>
|
||||
<b>pthread_exit</b> terminates the
|
||||
execution of the calling thread. All cleanup handlers that have been set
|
||||
for the calling thread with <a href='file:pthread_cleanup_push.html'><b>pthread_cleanup_push</b>(3)</a>
|
||||
are executed in reverse
|
||||
order (the most recently pushed handler is executed first). Finalization
|
||||
functions for thread-specific data are then called for all keys that have
|
||||
non- <b>NULL</b> values associated with them in the calling thread (see <a href='file:pthread_key_create.html'><b>pthread_key_create</b>(3)</a>
|
||||
).
|
||||
Finally, execution of the calling thread is stopped.
|
||||
<p> The <i>retval</i> argument
|
||||
is the return value of the thread. It can be consulted from another thread
|
||||
using <a href='file:pthread_join.html'><b>pthread_join</b>(3)</a>
|
||||
.
|
||||
<p>
|
||||
<h2><a name='sect3' href='#toc3'>Return Value</a></h2>
|
||||
The <b>pthread_exit</b> function never returns.
|
||||
|
||||
<p>
|
||||
<h2><a name='sect4' href='#toc4'>Author</a></h2>
|
||||
Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
<p>
|
||||
<h2><a name='sect5' href='#toc5'>See Also</a></h2>
|
||||
<a href='file:pthread_create.html'><b>pthread_create</b>(3)</a>
|
||||
, <a href='file:pthread_join.html'><b>pthread_join</b>(3)</a>
|
||||
.
|
||||
<p>
|
||||
|
||||
<hr><p>
|
||||
<a name='toc'><b>Table of Contents</b></a><p>
|
||||
<ul>
|
||||
<li><a name='toc0' href='#sect0'>Name</a></li>
|
||||
<li><a name='toc1' href='#sect1'>Synopsis</a></li>
|
||||
<li><a name='toc2' href='#sect2'>Description</a></li>
|
||||
<li><a name='toc3' href='#sect3'>Return Value</a></li>
|
||||
<li><a name='toc4' href='#sect4'>Author</a></li>
|
||||
<li><a name='toc5' href='#sect5'>See Also</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_GETW32THREADHANDLE_NP manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050505;322600">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGED" CONTENT="20110326;18290500">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
H4.cjk { font-family: "AR PL UMing CN" }
|
||||
H4.ctl { font-family: "Lohit Devanagari" }
|
||||
H2.cjk { font-family: "AR PL UMing CN" }
|
||||
H2.ctl { font-family: "Lohit Devanagari" }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4 CLASS="western">POSIX Threads for Windows – REFERENCE -
|
||||
<A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2 CLASS="western"><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P STYLE="font-weight: normal">pthread_getunique_np – get the
|
||||
unique sequence number associated with a thread</P>
|
||||
<H2 CLASS="western"><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>unsigned long long pthread_getunique_np(pthread_t</B> <I>thread</I><B>);</B></P>
|
||||
<H2 CLASS="western"><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Returns the <B>unique </B><SPAN STYLE="font-weight: normal">64 bit
|
||||
sequence number</SPAN> assigned to <I>thread</I>.</P>
|
||||
<P>In <B>Pthreads-win32:</B></P>
|
||||
<UL>
|
||||
<LI><P>the value returned is not reused after the thread terminates
|
||||
so it is unique for the life of the process</P>
|
||||
<LI><P>Windows native threads may obtain their own POSIX thread
|
||||
sequence number by first retrieving their <B>pthread_t</B> handle
|
||||
via <B>pthread_self</B> to use as the <I>thread</I> argument.</P>
|
||||
</UL>
|
||||
<P>This function was added for source code compatibility with some
|
||||
other POSIX threads implementations.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P>None.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
|
||||
<P><B>pthread_getunique_np</B> returns the unique sequence number for
|
||||
<I>thread</I>.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc5" NAME="sect5">Errors</A></H2>
|
||||
<P>None.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc6" NAME="sect6">Author</A></H2>
|
||||
<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0in"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0in"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0in"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0in"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0in"><A HREF="#sect4" NAME="toc4">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0in"><A HREF="#sect5" NAME="toc5">Errors</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect6" NAME="toc6">Author</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_GETW32THREADHANDLE_NP manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050505;322600">
|
||||
<META NAME="CHANGED" CONTENT="20050505;21523500">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P STYLE="font-weight: medium">pthread_getw32threadhandle_np – get
|
||||
the Win32 thread handle associated with a thread</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>HANDLE pthread_getw32threadhandle_np(pthread_t</B> <I>thread</I><B>);</B></P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Returns the Win32 native thread <B>HANDLE</B> that the POSIX
|
||||
thread <I>thread</I> is running as.</P>
|
||||
<P>Applications can use the Win32 handle to set Win32 specific
|
||||
attributes of the thread.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P>None.</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
|
||||
<P><B>pthread_getw32threadhandle_np</B> returns the Win32 native
|
||||
thread <B>HANDLE</B> for the specified POSIX thread <I>thread</I>.</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
|
||||
<P>None.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Author</A></H2>
|
||||
<P>Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect6" NAME="toc6">Author</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,118 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_JOIN(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;18232700">
|
||||
<META NAME="CHANGED" CONTENT="20050504;18421400">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_join - wait for termination of another thread
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_join(pthread_t </B><I>th</I><B>, void
|
||||
**</B><I>thread_return</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P><B>pthread_join</B> suspends the execution of the calling thread
|
||||
until the thread identified by <I>th</I> terminates, either by
|
||||
calling <A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> or by
|
||||
being cancelled.
|
||||
</P>
|
||||
<P>If <I>thread_return</I> is not <B>NULL</B>, the return value of <I>th</I>
|
||||
is stored in the location pointed to by <I>thread_return</I>. The
|
||||
return value of <I>th</I> is either the argument it gave to
|
||||
<A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> , or
|
||||
<B>PTHREAD_CANCELED</B> if <I>th</I> was cancelled.
|
||||
</P>
|
||||
<P>The joined thread <B>th</B> must be in the joinable state: it must
|
||||
not have been detached using <A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A>
|
||||
or the <B>PTHREAD_CREATE_DETACHED</B> attribute to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A>
|
||||
.
|
||||
</P>
|
||||
<P>When a joinable thread terminates, its memory resources (thread
|
||||
descriptor and stack) are not deallocated until another thread
|
||||
performs <B>pthread_join</B> on it. Therefore, <B>pthread_join</B>
|
||||
must be called once for each joinable thread created to avoid memory
|
||||
leaks.
|
||||
</P>
|
||||
<P>At most one thread can wait for the termination of a given thread.
|
||||
Calling <B>pthread_join</B> on a thread <I>th</I> on which another
|
||||
thread is already waiting for termination returns an error.
|
||||
</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P><B>pthread_join</B> is a cancellation point. If a thread is
|
||||
cancelled while suspended in <B>pthread_join</B>, the thread
|
||||
execution resumes immediately and the cancellation is executed
|
||||
without waiting for the <I>th</I> thread to terminate. If
|
||||
cancellation occurs during <B>pthread_join</B>, the <I>th</I> thread
|
||||
remains not joined.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
|
||||
<P>On success, the return value of <I>th</I> is stored in the
|
||||
location pointed to by <I>thread_return</I>, and 0 is returned. On
|
||||
error, a non-zero error code is returned.
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
|
||||
<DL>
|
||||
<DT><B>ESRCH</B>
|
||||
</DT><DD>
|
||||
No thread could be found corresponding to that specified by <I>th</I>.
|
||||
</DD><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD>
|
||||
The <I>th</I> thread has been detached.
|
||||
</DD><DT>
|
||||
<B>EINVAL</B>
|
||||
</DT><DD>
|
||||
Another thread is already waiting on termination of <I>th</I>.
|
||||
</DD><DT>
|
||||
<B>EDEADLK</B>
|
||||
</DT><DD STYLE="margin-bottom: 0.5cm">
|
||||
The <I>th</I> argument refers to the calling thread.
|
||||
</DD></DL>
|
||||
<H2>
|
||||
<A HREF="#toc6" NAME="sect6">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">See Also</A></H2>
|
||||
<P><A HREF="pthread_exit.html"><B>pthread_exit</B>(3)</A> ,
|
||||
<A HREF="pthread_detach.html"><B>pthread_detach</B>(3)</A> ,
|
||||
<A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> ,
|
||||
<A HREF="pthread_attr_setdetachstate.html"><B>pthread_attr_setdetachstate</B>(3)</A>
|
||||
, <A HREF="pthread_cleanup_push.html"><B>pthread_cleanup_push</B>(3)</A>
|
||||
, <A HREF="pthread_key_create.html"><B>pthread_key_create</B>(3)</A>
|
||||
.
|
||||
</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect7" NAME="toc7">See Also</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,211 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_SPECIFIC(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;18425400">
|
||||
<META NAME="CHANGED" CONTENT="20050509;18220200">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_key_create, pthread_key_delete, pthread_setspecific,
|
||||
pthread_getspecific - management of thread-specific data
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_key_create(pthread_key_t *</B><I>key</I><B>, void
|
||||
(*</B><I>destr_function</I><B>) (void *));</B>
|
||||
</P>
|
||||
<P><B>int pthread_key_delete(pthread_key_t </B><I>key</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_setspecific(pthread_key_t </B><I>key</I><B>, const
|
||||
void *</B><I>pointer</I><B>);</B>
|
||||
</P>
|
||||
<P><B>void * pthread_getspecific(pthread_key_t </B><I>key</I><B>);</B>
|
||||
</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>Programs often need global or static variables that have different
|
||||
values in different threads. Since threads share one memory space,
|
||||
this cannot be achieved with regular variables. Thread-specific data
|
||||
is the POSIX threads answer to this need.
|
||||
</P>
|
||||
<P>Each thread possesses a private memory block, the thread-specific
|
||||
data area, or TSD area for short. This area is indexed by TSD keys.
|
||||
The TSD area associates values of type <B>void *</B> to TSD keys. TSD
|
||||
keys are common to all threads, but the value associated with a given
|
||||
TSD key can be different in each thread.
|
||||
</P>
|
||||
<P>For concreteness, the TSD areas can be viewed as arrays of <B>void
|
||||
*</B> pointers, TSD keys as integer indices into these arrays, and
|
||||
the value of a TSD key as the value of the corresponding array
|
||||
element in the calling thread.
|
||||
</P>
|
||||
<P>When a thread is created, its TSD area initially associates <B>NULL</B>
|
||||
with all keys.
|
||||
</P>
|
||||
<P><B>pthread_key_create</B> allocates a new TSD key. The key is
|
||||
stored in the location pointed to by <I>key</I>. There is a limit of
|
||||
<B>PTHREAD_KEYS_MAX</B> on the number of keys allocated at a given
|
||||
time. The value initially associated with the returned key is <B>NULL</B>
|
||||
in all currently executing threads.
|
||||
</P>
|
||||
<P>The <I>destr_function</I> argument, if not <B>NULL</B>, specifies
|
||||
a destructor function associated with the key. When a thread
|
||||
terminates via <B>pthread_exit</B> or by cancellation, <I>destr_function</I>
|
||||
is called with arguments the value associated with the key in that
|
||||
thread. The <I>destr_function</I> is not called if that value is <B>NULL</B><SPAN STYLE="font-weight: medium">
|
||||
or the key has been deleted</SPAN>. The order in which destructor
|
||||
functions are called at thread termination time is unspecified.
|
||||
</P>
|
||||
<P>Before the destructor function is called, the <B>NULL</B> value is
|
||||
associated with the key in the current thread. A destructor function
|
||||
might, however, re-associate non- <B>NULL</B> values to that key or
|
||||
some other key. To deal with this, if after all the destructors have
|
||||
been called for all non- <B>NULL</B> values, there are still some
|
||||
non- <B>NULL</B> values with associated destructors, then the process
|
||||
is repeated.</P>
|
||||
<P><B>pthread_key_delete</B> deallocates a TSD key. It does not check
|
||||
whether non- <B>NULL</B> values are associated with that key in the
|
||||
currently executing threads, nor call the destructor function
|
||||
associated with the key.
|
||||
</P>
|
||||
<P><B>pthread_setspecific</B> changes the value associated with <I>key</I>
|
||||
in the calling thread, storing the given <I>pointer</I> instead.
|
||||
</P>
|
||||
<P><B>pthread_getspecific</B> returns the value currently associated
|
||||
with <I>key</I> in the calling thread.
|
||||
</P>
|
||||
<P>The routines <B>pthread_setspecific</B>, <B>pthread_getspecific</B>,
|
||||
and <B>pthread_key_delete</B> can be called from <I>destr_function</I>
|
||||
targeting any valid key including the key on which <I>destr_function</I>
|
||||
is currently operating. If <B>pthread_getspecific</B> is called on
|
||||
the key whose thread specific data is being destroyed, the value NULL
|
||||
is returned, unless <B>pthread_setspecific</B> was called previously
|
||||
on that key from within <I>destr_function</I> to set the value to
|
||||
non-NULL. For some implementations the effect of calling
|
||||
<B>pthread_setspecific</B> from within <I>destr_function</I> can be
|
||||
either memory leakage or infinite loops if <I>destr_function</I> has
|
||||
already been called at least <B>PTHREAD_DESTRUCTOR_ITERATIONS</B>
|
||||
times.</P>
|
||||
<P STYLE="font-weight: medium"><B>Pthreads-w32</B> stops running key
|
||||
<I>destr_function</I> routines after <B>PTHREAD_DESTRUCTOR_ITERATIONS</B>
|
||||
iterations, even if some non- <B>NULL</B> values with associated
|
||||
descriptors remain. If memory is allocated and associated with a key
|
||||
from within <I>destr_function</I>, that memory may not be reclaimed
|
||||
because that key's <I>destr_function</I>, may not run again.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
|
||||
<P><B>pthread_key_create</B>, <B>pthread_key_delete</B>, and
|
||||
<B>pthread_setspecific</B> return 0 on success and a non-zero error
|
||||
code on failure. If successful, <B>pthread_key_create</B> stores the
|
||||
newly allocated key in the location pointed to by its <I>key</I>
|
||||
argument.
|
||||
</P>
|
||||
<P><B>pthread_getspecific</B> returns the value associated with <I>key</I>
|
||||
on success, and <B>NULL</B> on error.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
|
||||
<P><B>pthread_key_create</B> returns the following error code on
|
||||
error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EAGAIN</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE STYLE="margin-left: 5cm">
|
||||
<B>PTHREAD_KEYS_MAX</B> keys are already allocated
|
||||
</BLOCKQUOTE>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOMEM</B>
|
||||
</DT></DL>
|
||||
</DL>
|
||||
<BLOCKQUOTE STYLE="margin-left: 5cm">
|
||||
Insufficient memory to allocate the key.
|
||||
</BLOCKQUOTE>
|
||||
<P><B>pthread_key_delete</B> and <B>pthread_setspecific</B> return
|
||||
the following error code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<I>key</I> is not a valid, allocated TSD key
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
<B>pthread_getspecific</B> returns <B>NULL</B> if <I>key</I> is not a
|
||||
valid, allocated TSD key.
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
|
||||
<P><A HREF="pthread_create.html">pthread_create(3)</A> ,
|
||||
<A HREF="pthread_exit.html">pthread_exit(3)</A> ,
|
||||
<A HREF="pthread_cancel.html">pthread_testcancel(3)</A> .
|
||||
</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">Example</A></H2>
|
||||
<P>The following code fragment allocates a thread-specific array of
|
||||
100 characters, with automatic reclamation at thread exit:
|
||||
</P>
|
||||
<BLOCKQUOTE><BR><BR>
|
||||
</BLOCKQUOTE>
|
||||
<PRE STYLE="margin-left: 1cm; margin-right: 1cm">/* Key for the thread-specific buffer */
|
||||
static pthread_key_t buffer_key;
|
||||
/* Once-only initialisation of the key */
|
||||
static pthread_once_t buffer_key_once = PTHREAD_ONCE_INIT;
|
||||
/* Allocate the thread-specific buffer */
|
||||
void buffer_alloc(void)
|
||||
{
|
||||
pthread_once(&buffer_key_once, buffer_key_alloc);
|
||||
pthread_setspecific(buffer_key, malloc(100));
|
||||
}
|
||||
/* Return the thread-specific buffer */
|
||||
char * get_buffer(void)
|
||||
{
|
||||
return (char *) pthread_getspecific(buffer_key);
|
||||
}
|
||||
/* Allocate the key */
|
||||
static void buffer_key_alloc()
|
||||
{
|
||||
pthread_key_create(&buffer_key, buffer_destroy);
|
||||
}
|
||||
/* Free the thread-specific buffer */
|
||||
static void buffer_destroy(void * buf)
|
||||
{
|
||||
free(buf);
|
||||
}</PRE>
|
||||
<HR>
|
||||
<BLOCKQUOTE STYLE="margin-left: 0cm; margin-right: 0cm"><A NAME="toc"></A>
|
||||
<B>Table of Contents</B></BLOCKQUOTE>
|
||||
<UL>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
|
||||
Value</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">See
|
||||
Also</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE><A HREF="#sect7" NAME="toc7">Example</A>
|
||||
</BLOCKQUOTE>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,152 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_SIGNAL(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050504;18500100">
|
||||
<META NAME="CHANGED" CONTENT="20050504;23005800">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_sigmask, pthread_kill, sigwait - handling of signals in
|
||||
threads
|
||||
</P>
|
||||
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B> <BR><B>#include <signal.h></B>
|
||||
</P>
|
||||
<P><B>int pthread_sigmask(int </B><I>how</I><B>, const sigset_t
|
||||
*</B><I>newmask</I><B>, sigset_t *</B><I>oldmask</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_kill(pthread_t </B><I>thread</I><B>, int </B><I>signo</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int sigwait(const sigset_t *</B>set, <B>int</B> *sig);</P>
|
||||
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P><B>pthread_sigmask</B> changes the signal mask for the calling
|
||||
thread as described by the <I>how</I> and <I>newmask</I> arguments.
|
||||
If <I>oldmask</I> is not <B>NULL</B>, the previous signal mask is
|
||||
stored in the location pointed to by <I>oldmask</I>. <B>Pthreads-w32</B>
|
||||
implements this function but no other function uses the signal mask
|
||||
yet.</P>
|
||||
<P>The meaning of the <I>how</I> and <I>newmask</I> arguments is the
|
||||
same as for <B><SPAN STYLE="font-style: normal">sigprocmask</SPAN></B>(2).
|
||||
If <I>how</I> is <B>SIG_SETMASK</B>, the signal mask is set to
|
||||
<I>newmask</I>. If <I>how</I> is <B>SIG_BLOCK</B>, the signals
|
||||
specified to <I>newmask</I> are added to the current signal mask. If
|
||||
<I>how</I> is <B>SIG_UNBLOCK</B>, the signals specified to <I>newmask</I>
|
||||
are removed from the current signal mask.
|
||||
</P>
|
||||
<P>Recall that signal masks are set on a per-thread basis, but signal
|
||||
actions and signal handlers, as set with <B>sigaction</B>(2), are
|
||||
shared between all threads.
|
||||
</P>
|
||||
<P><B>pthread_kill</B> send signal number <I>signo</I> to the thread
|
||||
<I>thread</I>. <B>Pthreads-w32</B> only supports signal number 0,
|
||||
which does not send any signal but causes <B>pthread_kill</B> to
|
||||
return an error if <I>thread</I> is not valid.</P>
|
||||
<P><B>sigwait</B> suspends the calling thread until one of the
|
||||
signals in <I>set</I> is delivered to the calling thread. It then
|
||||
stores the number of the signal received in the location pointed to
|
||||
by <I>sig</I> and returns. The signals in <I>set</I> must be blocked
|
||||
and not ignored on entrance to <B>sigwait</B>. If the delivered
|
||||
signal has a signal handler function attached, that function is <I>not</I>
|
||||
called. <B>Pthreads-w32</B> implements this function as a
|
||||
cancellation point only - it does not wait for any signals and does
|
||||
not change the location pointed to by <I>sig</I>.</P>
|
||||
<H2><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P><B>sigwait</B> is a cancellation point.
|
||||
</P>
|
||||
<H2><A HREF="#toc4" NAME="sect4">Return Value</A></H2>
|
||||
<P>On success, 0 is returned. On failure, a non-zero error code is
|
||||
returned.
|
||||
</P>
|
||||
<H2><A HREF="#toc5" NAME="sect5">Errors</A></H2>
|
||||
<P>The <B>pthread_sigmask</B> function returns the following error
|
||||
codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<I>how</I> is not one of <B>SIG_SETMASK</B>, <B>SIG_BLOCK</B>, or
|
||||
<B>SIG_UNBLOCK</B>
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_kill</B> function returns the following error codes on
|
||||
error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<I>signo</I> is not a valid signal number or is unsupported.</DD><DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
<B>ESRCH</B>
|
||||
</DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
|
||||
the thread <I>thread</I> does not exist (e.g. it has already
|
||||
terminated)
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>sigwait</B> function never returns an error.
|
||||
</P>
|
||||
<H2><A HREF="#toc6" NAME="sect6">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2><A HREF="#toc7" NAME="sect7">See Also</A></H2>
|
||||
<P>
|
||||
</P>
|
||||
<H2><A HREF="#toc8" NAME="sect8">Notes</A></H2>
|
||||
<P>In any implementation, for <B>sigwait</B> to work reliably, the
|
||||
signals being waited for must be blocked in all threads, not only in
|
||||
the calling thread, since otherwise the POSIX semantics for signal
|
||||
delivery do not guarantee that it’s the thread doing the <B>sigwait</B>
|
||||
that will receive the signal. The best way to achieve this is to
|
||||
block those signals before any threads are created, and never unblock
|
||||
them in the program other than by calling <B>sigwait</B>. This works
|
||||
because all threads inherit their initial sigmask from their creating
|
||||
thread.</P>
|
||||
<H2><A HREF="#toc9" NAME="sect9">Bugs</A></H2>
|
||||
<P><B>Pthreads-w32</B> does not implement signals yet and so these
|
||||
routines have almost no use except to prevent the compiler or linker
|
||||
from complaining. <B>pthread_kill</B> is useful in determining if the
|
||||
thread is a valid thread, but since many threads implementations
|
||||
reuse thread IDs, the valid thread may no longer be the thread you
|
||||
think it is, and so this method of determining thread validity is not
|
||||
portable, and very risky. <B>Pthreads-w32</B> from version 1.0.0
|
||||
onwards implements pseudo-unique thread IDs, so applications that use
|
||||
this technique (but really shouldn't) have some protection.</P>
|
||||
<HR>
|
||||
<P><A NAME="toc"></A><B>Table of Contents</B></P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Return
|
||||
Value</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Errors</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Author</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">See
|
||||
Also</A>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Notes</A>
|
||||
</P>
|
||||
<LI><P><A HREF="#sect9" NAME="toc9">Bugs</A>
|
||||
</P>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,356 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>PTHREAD_MUTEX(3) manual page</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Linux)">
|
||||
<META NAME="CREATED" CONTENT="20050505;5000">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGED" CONTENT="20110326;15072100">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<META NAME="CHANGEDBY" CONTENT="Ross Johnson">
|
||||
<!-- manual page source format generated by PolyglotMan v3.2, -->
|
||||
<!-- available at http://polyglotman.sourceforge.net/ -->
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
H4.cjk { font-family: "AR PL UMing CN" }
|
||||
H4.ctl { font-family: "Lohit Devanagari" }
|
||||
H2.cjk { font-family: "AR PL UMing CN" }
|
||||
H2.ctl { font-family: "Lohit Devanagari" }
|
||||
PRE.cjk { font-family: "AR PL UMing CN", monospace }
|
||||
PRE.ctl { font-family: "Lohit Devanagari", monospace }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
|
||||
<H4 CLASS="western">POSIX Threads for Windows – REFERENCE -
|
||||
<A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
|
||||
<P><A HREF="index.html">Reference Index</A></P>
|
||||
<P><A HREF="#toc">Table of Contents</A></P>
|
||||
<H2 CLASS="western"><A HREF="#toc0" NAME="sect0">Name</A></H2>
|
||||
<P>pthread_mutex_init, pthread_mutex_lock, pthread_mutex_trylock,
|
||||
pthread_mutex_timedlock, pthread_mutex_unlock,
|
||||
pthread_mutex_consistent, pthread_mutex_destroy - operations on
|
||||
mutexes
|
||||
</P>
|
||||
<H2 CLASS="western"><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
|
||||
<P><B>#include <pthread.h></B>
|
||||
</P>
|
||||
<P><B>#include <time.h></B></P>
|
||||
<P><B>pthread_mutex_t </B><I>fastmutex</I> <B>=
|
||||
PTHREAD_MUTEX_INITIALIZER;</B>
|
||||
</P>
|
||||
<P><B>pthread_mutex_t </B><I>recmutex</I> <B>=
|
||||
PTHREAD_RECURSIVE_MUTEX_INITIALIZER;</B>
|
||||
</P>
|
||||
<P><B>pthread_mutex_t </B><I>errchkmutex</I> <B>=
|
||||
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER;</B>
|
||||
</P>
|
||||
<P><B>pthread_mutex_t </B><I>recmutex</I> <B>=
|
||||
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;</B>
|
||||
</P>
|
||||
<P><B>pthread_mutex_t </B><I>errchkmutex</I> <B>=
|
||||
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_init(pthread_mutex_t *</B><I>mutex</I><B>,
|
||||
const pthread_mutexattr_t *</B><I>mutexattr</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_lock(pthread_mutex_t *</B><I>mutex</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_trylock(pthread_mutex_t *</B><I>mutex</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_timedlock(pthread_mutex_t *</B><I>mutex,
|
||||
</I><B>const struct timespec *</B><I>abs_timeout</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_unlock(pthread_mutex_t *</B><I>mutex</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_consistent(pthread_mutex_t *</B><I>mutex</I><B>);</B>
|
||||
</P>
|
||||
<P><B>int pthread_mutex_destroy(pthread_mutex_t *</B><I>mutex</I><B>);</B>
|
||||
</P>
|
||||
<H2 CLASS="western"><A HREF="#toc2" NAME="sect2">Description</A></H2>
|
||||
<P>A mutex is a MUTual EXclusion device, and is useful for protecting
|
||||
shared data structures from concurrent modifications, and
|
||||
implementing critical sections and monitors.
|
||||
</P>
|
||||
<P>A mutex has two possible states: unlocked (not owned by any
|
||||
thread), and locked (owned by one thread). A mutex can never be owned
|
||||
by two different threads simultaneously. A thread attempting to lock
|
||||
a mutex that is already locked by another thread is suspended until
|
||||
the owning thread unlocks the mutex first.
|
||||
</P>
|
||||
<P><B>pthread_mutex_init</B> initializes the mutex object pointed to
|
||||
by <I>mutex</I> according to the mutex attributes specified in
|
||||
<I>mutexattr</I>. If <I>mutexattr</I> is <B>NULL</B>, default
|
||||
attributes are used instead.
|
||||
</P>
|
||||
<P>The type of a mutex determines whether it can be locked again by a
|
||||
thread that already owns it. The default type is “normal”. See
|
||||
<A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B>(3)</A>
|
||||
for more information on mutex attributes.
|
||||
</P>
|
||||
<P>Variables of type <B>pthread_mutex_t</B> can also be initialized
|
||||
statically, using the constants <B>PTHREAD_MUTEX_INITIALIZER</B> (for
|
||||
normal “fast” mutexes), <B>PTHREAD_RECURSIVE_MUTEX_INITIALIZER</B>
|
||||
(for recursive mutexes), and <B>PTHREAD_ERRORCHECK_MUTEX_INITIALIZER</B>
|
||||
(for error checking mutexes). <SPAN STYLE="font-weight: normal">In
|
||||
the </SPAN><B>Pthreads-w32</B> <SPAN STYLE="font-weight: normal">implementation,
|
||||
an application should still call </SPAN><B>pthread_mutex_destroy</B>
|
||||
<SPAN STYLE="font-weight: normal">at some point to ensure that any
|
||||
resources consumed by the mutex are released.</SPAN></P>
|
||||
<P><SPAN STYLE="font-weight: normal">Any mutex type can be
|
||||
initialized as a </SPAN><B>robust mutex</B><SPAN STYLE="font-weight: normal">.
|
||||
See </SPAN><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B><SPAN STYLE="font-weight: normal">(3)</SPAN></A>
|
||||
<SPAN STYLE="font-weight: normal">for more information as well as the
|
||||
section </SPAN><I><U><SPAN STYLE="font-weight: normal">Robust Mutexes</SPAN></U></I>
|
||||
<SPAN STYLE="font-weight: normal">below.</SPAN></P>
|
||||
<P><B>pthread_mutex_lock</B> locks the given mutex. If the mutex is
|
||||
currently unlocked, it becomes locked and owned by the calling
|
||||
thread, and <B>pthread_mutex_lock</B> returns immediately. If the
|
||||
mutex is already locked by another thread, <B>pthread_mutex_lock</B>
|
||||
suspends the calling thread until the mutex is unlocked.</P>
|
||||
<P>If the mutex is already locked by the calling thread, the behavior
|
||||
of <B>pthread_mutex_lock</B> depends on the type of the mutex. If the
|
||||
mutex is of the “normal” type, the calling thread is suspended
|
||||
until the mutex is unlocked, thus effectively causing the calling
|
||||
thread to deadlock. If the mutex is of the ‘‘error checking’’
|
||||
type, <B>pthread_mutex_lock</B> returns immediately with the error
|
||||
code <B>EDEADLK</B>. If the mutex is of the ‘‘recursive’’
|
||||
type, <B>pthread_mutex_lock</B> succeeds and returns immediately,
|
||||
recording the number of times the calling thread has locked the
|
||||
mutex. An equal number of <B>pthread_mutex_unlock</B> operations must
|
||||
be performed before the mutex returns to the unlocked state.
|
||||
</P>
|
||||
<P><B>pthread_mutex_trylock</B> behaves identically to
|
||||
<B>pthread_mutex_lock</B>, except that it does not block the calling
|
||||
thread if the mutex is already locked by another thread (or by the
|
||||
calling thread in the case of a “normal” or “<SPAN STYLE="font-style: normal">errorcheck</SPAN>”
|
||||
mutex). Instead, <B>pthread_mutex_trylock</B> returns immediately
|
||||
with the error code <B>EBUSY</B>.
|
||||
</P>
|
||||
<P><B>pthread_mutex_timedlock</B> behaves identically to
|
||||
<B>pthread_mutex_lock</B>, except that if it cannot acquire the lock
|
||||
before the <I>abs_timeout</I> time, the call returns with the error
|
||||
code <B>ETIMEDOUT</B>. If the mutex can be locked immediately it is,
|
||||
and the <B>abs_timeout</B> parameter is ignored.</P>
|
||||
<P><B>pthread_mutex_consistent</B> may only be called for
|
||||
<B>PTHREAD_MUTEX_ROBUST</B> mutexes. It simply marks the mutex as
|
||||
consistent. See <I><U>Robust Mutexes</U></I> below.</P>
|
||||
<P><B>pthread_mutex_unlock</B> unlocks the given mutex. The mutex is
|
||||
assumed to be locked and owned by the calling thread on entrance to
|
||||
<B>pthread_mutex_unlock</B>. If the mutex is of the “normal”
|
||||
type, <B>pthread_mutex_unlock</B> always returns it to the unlocked
|
||||
state. If it is of the ‘‘recursive’’ type, it decrements the
|
||||
locking count of the mutex (number of <B>pthread_mutex_lock</B>
|
||||
operations performed on it by the calling thread), and only when this
|
||||
count reaches zero is the mutex actually unlocked. In <B>Pthreads-win32</B>,
|
||||
non-robust normal or default mutex types do not check the owner of
|
||||
the mutex. For all types of robust mutexes the owner is checked and
|
||||
an error code is returned if the calling thread does not own the
|
||||
mutex.</P>
|
||||
<P>On ‘‘error checking’’ mutexes, <B>pthread_mutex_unlock</B>
|
||||
actually checks at run-time that the mutex is locked on entrance, and
|
||||
that it was locked by the same thread that is now calling
|
||||
<B>pthread_mutex_unlock</B>. If these conditions are not met, an
|
||||
error code is returned and the mutex remains unchanged. ‘‘Normal’’
|
||||
[non-robust] mutexes perform no such checks, thus allowing a locked
|
||||
mutex to be unlocked by a thread other than its owner. This is
|
||||
non-portable behavior and is not meant to be used as a feature.</P>
|
||||
<P><B>pthread_mutex_destroy</B> destroys a mutex object, freeing the
|
||||
resources it might hold. The mutex must be unlocked on entrance.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc10" NAME="sect10">Robust Mutexes</A></H2>
|
||||
<P>If the mutex is <B>PTHREAD_MUTEX_ROBUST</B> and the owning thread
|
||||
terminates without unlocking the mutex the implementation will wake
|
||||
one waiting thread, if any. The next thread to acquire the mutex will
|
||||
receive the error code <B>EOWNERDEAD</B><SPAN STYLE="font-weight: normal">,
|
||||
in which case that thread should if possible ensure that the state
|
||||
protected by the mutex is consistent and then call
|
||||
</SPAN><B>pthread_mutex_consistent</B> <SPAN STYLE="font-weight: normal">before
|
||||
unlocking. The mutex may then be used normally from then on.</SPAN></P>
|
||||
<P><SPAN STYLE="font-weight: normal">If the thread cannot recover the
|
||||
state then it must call </SPAN><B>pthread_mutex_unlock</B><SPAN STYLE="font-weight: normal">
|
||||
without calling </SPAN><B>pthread_mutex_consistent</B><SPAN STYLE="font-weight: normal">.
|
||||
This will mark the mutex as unusable and wake all currently waiting
|
||||
threads with the return code </SPAN><B>ENOTRECOVERABLE</B><SPAN STYLE="font-weight: normal">.
|
||||
The error indicates that the mutex is no longer usable and any
|
||||
threads that receive this error code from any lock operation have not
|
||||
acquired the mutex. The mutex can be made consistent by calling
|
||||
</SPAN><B>pthread_mutex_destroy</B> <SPAN STYLE="font-weight: normal">to
|
||||
uninitialize the mutex, and calling </SPAN><B>pthread_mutex_int</B>
|
||||
<SPAN STYLE="font-weight: normal">to reinitialize the mutex. However,
|
||||
the state that was protected by the mutex remains inconsistent and
|
||||
some form of application recovery is required.</SPAN></P>
|
||||
<P><SPAN STYLE="font-weight: normal">If a thread that receives the
|
||||
</SPAN><B>EOWNERDEAD</B> <SPAN STYLE="font-weight: normal">error code
|
||||
itself terminates without unlocking the mutex then this behaviour
|
||||
repeats for the next acquiring thread.</SPAN></P>
|
||||
<P><SPAN STYLE="font-weight: normal">Applications must ensure that
|
||||
they check the return values from all calls targeting robust mutexes.</SPAN></P>
|
||||
<P STYLE="font-weight: normal">Robust mutexes are slower because they
|
||||
require some additional overhead, however they are not very much
|
||||
slower than the non-robust recursive type.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc3" NAME="sect3">Cancellation</A></H2>
|
||||
<P>None of the mutex functions is a cancellation point, not even
|
||||
<B>pthread_mutex_lock</B>, in spite of the fact that it can suspend a
|
||||
thread for arbitrary durations. This way, the status of mutexes at
|
||||
cancellation points is predictable, allowing cancellation handlers to
|
||||
unlock precisely those mutexes that need to be unlocked before the
|
||||
thread stops executing. Consequently, threads using deferred
|
||||
cancellation should never hold a mutex for extended periods of time.
|
||||
</P>
|
||||
<H2 CLASS="western"><A HREF="#toc4" NAME="sect4">Async-signal Safety</A></H2>
|
||||
<P>The mutex functions are not async-signal safe. What this means is
|
||||
that they should not be called from a signal handler. In particular,
|
||||
calling <B>pthread_mutex_lock</B> or <B>pthread_mutex_unlock</B> from
|
||||
a signal handler may deadlock the calling thread.
|
||||
</P>
|
||||
<H2 CLASS="western"><A HREF="#toc5" NAME="sect5">Return Value</A></H2>
|
||||
<P><B>pthread_mutex_init</B> always returns 0. The other mutex
|
||||
functions return 0 on success and a non-zero error code on error.
|
||||
</P>
|
||||
<H2 CLASS="western"><A HREF="#toc6" NAME="sect6">Errors</A></H2>
|
||||
<P>The <B>pthread_mutex_lock</B> function returns the following error
|
||||
code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in"><B>EINVAL</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex has not been properly initialized.
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EDEADLK</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex is already locked by the calling thread (‘‘error
|
||||
checking’’ mutexes only).
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EOWNERDEAD</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the robust mutex is now locked by the calling thread after the
|
||||
previous owner terminated without unlocking it.</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>ENOTRECOVERABLE</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the robust mutex is not locked and is no longer usable after the
|
||||
previous owner unlocked it without calling
|
||||
pthread_mutex_consistent.</DD></DL>
|
||||
<DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
The <B>pthread_mutex_trylock</B> function returns the following
|
||||
error codes on error:
|
||||
</DD><DL>
|
||||
<DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EBUSY</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex could not be acquired because it was currently locked.
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex has not been properly initialized.
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EOWNERDEAD</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the robust mutex is now locked by the calling thread after the
|
||||
previous owner terminated without unlocking it.</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>ENOTRECOVERABLE</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the robust mutex is not locked and is no longer usable after the
|
||||
previous owner unlocked it without calling
|
||||
pthread_mutex_consistent.</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_mutex_timedlock</B> function returns the following
|
||||
error codes on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in"><B>ETIMEDOUT</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex could not be acquired before the <I>abs_timeout</I> time
|
||||
arrived.
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex has not been properly initialized.
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EOWNERDEAD</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the robust mutex is now locked by the calling thread after the
|
||||
previous owner terminated without unlocking it.</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>ENOTRECOVERABLE</B></DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the robust mutex is not locked and is no longer usable after the
|
||||
previous owner unlocked it without calling
|
||||
pthread_mutex_consistent.</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_mutex_unlock</B> function returns the following error
|
||||
code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in"><B>EINVAL</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex has not been properly initialized.
|
||||
</DD><DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
<B>EPERM</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the calling thread does not own the mutex (‘‘error checking’’
|
||||
mutexes only).
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<P>
|
||||
The <B>pthread_mutex_destroy</B> function returns the following error
|
||||
code on error:
|
||||
</P>
|
||||
<DL>
|
||||
<DL>
|
||||
<DT STYLE="margin-right: 0.39in; margin-bottom: 0.2in"><B>EBUSY</B>
|
||||
</DT><DD STYLE="margin-right: 0.39in; margin-bottom: 0.2in">
|
||||
the mutex is currently locked.
|
||||
</DD></DL>
|
||||
</DL>
|
||||
<H2 CLASS="western">
|
||||
<A HREF="#toc7" NAME="sect7">Author</A></H2>
|
||||
<P>Xavier Leroy <Xavier.Leroy@inria.fr>
|
||||
</P>
|
||||
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
|
||||
<H2 CLASS="western"><A HREF="#toc8" NAME="sect8">See Also</A></H2>
|
||||
<P><A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_init</B>(3)</A>
|
||||
, <A HREF="pthread_mutexattr_init.html"><B>pthread_mutexattr_settype</B>(3)</A>
|
||||
, <A HREF="pthread_cancel.html"><B>pthread_cancel</B>(3)</A> .
|
||||
</P>
|
||||
<H2 CLASS="western"><A HREF="#toc9" NAME="sect9">Example</A></H2>
|
||||
<P>A shared global variable <I>x</I> can be protected by a mutex as
|
||||
follows:
|
||||
</P>
|
||||
<PRE CLASS="western" STYLE="margin-left: 0.39in; margin-right: 0.39in">int x;
|
||||
pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;</PRE><BLOCKQUOTE STYLE="margin-left: 0in; margin-right: 0in">
|
||||
All accesses and modifications to <I>x</I> should be bracketed by
|
||||
calls to <B>pthread_mutex_lock</B> and <B>pthread_mutex_unlock</B> as
|
||||
follows:
|
||||
</BLOCKQUOTE>
|
||||
<PRE CLASS="western" STYLE="margin-left: 0.41in; margin-right: 0.79in">pthread_mutex_lock(&mut);
|
||||
/* operate on x */
|
||||
pthread_mutex_unlock(&mut);</PRE>
|
||||
<HR>
|
||||
<BLOCKQUOTE STYLE="margin-right: 2.75in"><A NAME="toc"></A><B>Table
|
||||
of Contents</B></BLOCKQUOTE>
|
||||
<UL>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect0" NAME="toc0">Name</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect1" NAME="toc1">Synopsis</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect2" NAME="toc2">Description</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect10" NAME="toc10">Robust
|
||||
Mutexes</A></BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect3" NAME="toc3">Cancellation</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect4" NAME="toc4">Async-signal
|
||||
Safety</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect5" NAME="toc5">Return
|
||||
Value</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect6" NAME="toc6">Errors</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect7" NAME="toc7">Author</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in; margin-bottom: 0in"><A HREF="#sect8" NAME="toc8">See
|
||||
Also</A>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-right: 2.75in"><A HREF="#sect9" NAME="toc9">Example</A>
|
||||
</BLOCKQUOTE>
|
||||
</UL>
|
||||
</BODY>
|
||||
</HTML>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue