Updated pthreads libraries for the Windows platform (pthread4w) to version 3.0.0.
This commit is contained in:
parent
2cee77b108
commit
86b4f64f86
43
README.md
43
README.md
@ -882,3 +882,46 @@ This work has been released under the **CC0 1.0 Universal** license.
|
||||
|
||||
For details, please refer to:
|
||||
<https://creativecommons.org/publicdomain/zero/1.0/legalcode>
|
||||
|
||||
Acknowledgement
|
||||
---------------
|
||||
|
||||
SlunkCrypt incorporates code from the following *third-party* software projects:
|
||||
|
||||
* The "checksum" algorithm used by the SlunkCrypt command-line application was adapted from the **BLAKE2** reference C implementation.
|
||||
```
|
||||
BLAKE2 reference source code package - reference C implementations
|
||||
Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the
|
||||
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
|
||||
your option. The terms of these licenses can be found at:
|
||||
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
|
||||
- OpenSSL license : https://www.openssl.org/source/license.html
|
||||
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
More information about the BLAKE2 hash function can be found at
|
||||
https://blake2.net.
|
||||
```
|
||||
|
||||
* ***Windows only:*** Builds of SlunkCypt that have multi-threading enabled use the **POSIX Threads for Windows (pthreads4w)** library.
|
||||
```
|
||||
Pthreads4w - POSIX Threads for Windows
|
||||
Copyright 1998 John E. Bossom
|
||||
Copyright 1999-2018, Pthreads4w contributors
|
||||
|
||||
Homepage: https://sourceforge.net/projects/pthreads4w/
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
||||
|
||||
▮
|
||||
|
@ -1,151 +0,0 @@
|
||||
Pthreads4w - a POSIX threads library for Microsoft Windows
|
||||
|
||||
|
||||
This file is Copyrighted
|
||||
------------------------
|
||||
|
||||
This file is covered under the following Copyright:
|
||||
|
||||
Copyright (C) 2001-2017 Ross P. Johnson
|
||||
All rights reserved.
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Pthreads4w is covered by the GNU Lesser General Public License
|
||||
------------------------------------------------------------------
|
||||
|
||||
Pthreads4w is open 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 version 3 of the
|
||||
License.
|
||||
|
||||
Pthreads4w is several binary link libraries, several modules,
|
||||
associated interface definition files and scripts used to control
|
||||
its compilation and installation.
|
||||
|
||||
Pthreads4w 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.
|
||||
|
||||
A copy of the GNU Lesser General Public License is distributed with
|
||||
Pthreads4w under the filename:
|
||||
|
||||
COPYING.FSF
|
||||
|
||||
You should have received a copy of the version 3 GNU Lesser General
|
||||
Public License with Pthreads4w; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place
|
||||
Suite 330
|
||||
Boston, MA 02111-1307
|
||||
USA
|
||||
|
||||
The contact addresses for Pthreads4w is as follows:
|
||||
|
||||
Homepage: http://sourceforge.net/projects/pthreads4w/
|
||||
Email: Ross Johnson
|
||||
Please use: Firstname.Lastname@homemail.com.au
|
||||
|
||||
|
||||
|
||||
Pthreads4w copyrights and exception files
|
||||
---------------------------------------------
|
||||
|
||||
With the exception of the files listed below, Pthreads4w
|
||||
is covered under the following GNU Lesser General Public License
|
||||
Copyrights:
|
||||
|
||||
Pthreads4w - POSIX Threads Library for Win32
|
||||
Copyright(C) 1998 John E. Bossom
|
||||
Copyright(C) 1999,2017 Pthreads4w contributors
|
||||
|
||||
The current list of contributors is contained
|
||||
in the file CONTRIBUTORS included with the source
|
||||
code distribution. The current list of CONTRIBUTORS
|
||||
can also be seen at the following WWW location:
|
||||
https://sourceforge.net/projects/pthreads4w//contributors.html
|
||||
|
||||
Contact Email: Ross Johnson
|
||||
Please use: Firstname.Lastname@homemail.com.au
|
||||
|
||||
These files are not covered under one of the Copyrights listed above:
|
||||
|
||||
COPYING
|
||||
COPYING.FSF
|
||||
tests/rwlock7.c
|
||||
tests/rwlock8.c
|
||||
tests/threestage.c
|
||||
|
||||
This file, COPYING, is distributed under the Copyright found at the
|
||||
top of this file. It is important to note that you may distribute
|
||||
verbatim copies of this file but you may not modify this file.
|
||||
|
||||
The file COPYING.FSF, which contains a copy of the version 3
|
||||
GNU Lesser General Public License, is itself copyrighted by the
|
||||
Free Software Foundation, Inc. Please note that the Free Software
|
||||
Foundation, Inc. does NOT have a copyright over Pthreads4w,
|
||||
only the COPYING.FSF that is supplied with Pthreads4w.
|
||||
|
||||
The file tests/rwlock7.c and tests/rwlock8.c are derived from code
|
||||
written by Dave Butenhof for his book 'Programming With POSIX(R) Threads'.
|
||||
The original code was obtained by free download from his website
|
||||
http://home.earthlink.net/~anneart/family/Threads/source.html
|
||||
and did not contain a copyright or author notice. It is assumed to
|
||||
be freely distributable.
|
||||
|
||||
In all cases one may use and distribute these exception files freely.
|
||||
And because one may freely distribute the LGPL covered files, the
|
||||
entire Pthreads4w source may be freely used and distributed.
|
||||
|
||||
|
||||
General Copyleft and License info
|
||||
---------------------------------
|
||||
|
||||
For general information on Copylefts, see:
|
||||
|
||||
http://www.gnu.org/copyleft/
|
||||
|
||||
For information on GNU Lesser General Public Licenses, see:
|
||||
|
||||
http://www.gnu.org/copyleft/lesser.html
|
||||
http://www.gnu.org/copyleft/lesser.txt
|
||||
|
||||
|
||||
Why Pthreads4w did not use the GNU Lesser General Public License
|
||||
--------------------------------------------------------------------
|
||||
|
||||
The goal of the Pthreads4w project has been to
|
||||
provide a quality and complete implementation of the POSIX
|
||||
threads API for Microsoft Windows within the limits imposed
|
||||
by virtue of it being a stand-alone library and not
|
||||
linked directly to other POSIX compliant libraries. For
|
||||
example, some functions and features, such as those based
|
||||
on POSIX signals, are missing.
|
||||
|
||||
Pthreads4w is a library, available in several different
|
||||
versions depending on supported compilers, and may be used
|
||||
as a dynamically linked module or a statically linked set of
|
||||
binary modules. It is not an application on it's own.
|
||||
|
||||
It was fully intended that Pthreads4w be usable with
|
||||
commercial software not covered by either the GPL or the LGPL
|
||||
licenses. Pthreads4w has many contributors to it's
|
||||
code base, many of whom have done so because they have
|
||||
used the library in commercial or proprietry software
|
||||
projects.
|
||||
|
||||
Releasing Pthreads4w under the LGPL ensures that the
|
||||
library can be used widely, while at the same time ensures
|
||||
that bug fixes and improvements to the Pthreads4w code
|
||||
itself is returned to benefit all current and future users
|
||||
of the library.
|
||||
|
||||
Although Pthreads4w makes it possible for applications
|
||||
that use POSIX threads to be ported to Win32 platforms, the
|
||||
broader goal of the project is to encourage the use of open
|
||||
standards, and in particular, to make it just a little easier
|
||||
for developers writing Win32 applications to consider
|
||||
widening the potential market for their products.
|
202
etc/deps/pthreads4w/LICENSE.txt
Normal file
202
etc/deps/pthreads4w/LICENSE.txt
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -1,23 +1,16 @@
|
||||
Pthreads4w (A.K.A. PTHREADS4W)
|
||||
PTHREADS4W (a.k.a. PTHREADS-WIN32)
|
||||
==================================
|
||||
|
||||
Pthreads4w is free software, distributed under the GNU Lesser
|
||||
General Public License (LGPL). See the file 'COPYING.LIB' for terms
|
||||
and conditions. Also see the file 'COPYING' for information
|
||||
specific to Pthreads4w, copyrights and the LGPL.
|
||||
|
||||
|
||||
What is it?
|
||||
-----------
|
||||
|
||||
Pthreads4w (a.k.a. pthreads4w) is an Open Source Software
|
||||
implementation of the Threads component of the POSIX 1003.1c 1995
|
||||
Standard (or later) for Microsoft's Windows environment. Some functions
|
||||
from POSIX 1003.1b are also supported, including semaphores. Other
|
||||
related functions include the set of read-write lock functions. The
|
||||
library also supports some of the functionality of the Open
|
||||
Group's Single Unix specification, namely mutex types, plus some common
|
||||
and Pthreads4w specific non-portable routines (see README.NONPORTABLE).
|
||||
Pthreads4w is an Open Source Software implementation of the Threads
|
||||
component of the POSIX 1003.1c 1995 Standard (or later) for Microsoft's
|
||||
Windows environment. Some functions from POSIX 1003.1b are also supported,
|
||||
including semaphores. Other related functions include the set of read-write
|
||||
lock functions. The library also supports some of the functionality of the
|
||||
Open Group's Single Unix specification, namely mutex types, plus some common
|
||||
and pthreads4w specific non-portable routines (see README.NONPORTABLE).
|
||||
|
||||
See the file "ANNOUNCE" for more information including standards
|
||||
conformance details and the list of supported and unsupported
|
||||
@ -37,15 +30,15 @@ QueueUserAPCEx by Panagiotis E. Hadjidoukas
|
||||
For true async cancellation 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.
|
||||
Both the DLL and driver are provided with the Pthreads4w.exe
|
||||
self-unpacking ZIP, and on the Pthreads4w FTP site (in source
|
||||
Both the DLL and driver are provided with the pthreads4w.exe
|
||||
self-unpacking ZIP, and on the pthreads4w FTP site (in source
|
||||
and pre-built forms). Currently this is a separate LGPL package to
|
||||
Pthreads4w. See the README in the QueueUserAPCEx folder for
|
||||
pthreads4w. See the README in the QueueUserAPCEx folder for
|
||||
installation instructions.
|
||||
|
||||
Pthreads4w will automatically detect if the QueueUserAPCEx DLL
|
||||
pthreads4w will automatically detect if the QueueUserAPCEx DLL
|
||||
QuserEx.DLL is available and whether the driver AlertDrv.sys is
|
||||
loaded. If it is not available, Pthreads4w will simulate async
|
||||
loaded. If it is not available, pthreads4w will simulate async
|
||||
cancellation, which means that it can async cancel only threads that
|
||||
are runnable. The simulated async cancellation cannot cancel blocked
|
||||
threads.
|
||||
@ -171,7 +164,7 @@ The numbers are changed as follows:
|
||||
|
||||
|
||||
DLL compatibility numbering is an attempt to ensure that applications
|
||||
always load a compatible Pthreads4w DLL by using a DLL naming system
|
||||
always load a compatible pthreads4w DLL by using a DLL naming system
|
||||
that is consistent with the version numbering system. It also allows
|
||||
older and newer DLLs to coexist in the same filesystem so that older
|
||||
applications can continue to be used. For pre .NET Windows systems,
|
||||
@ -212,10 +205,10 @@ If you use either pthreadVCE[2] or pthreadGCE[2]:
|
||||
|
||||
If your application contains catch(...) blocks in your POSIX
|
||||
threads then you will need to replace the "catch(...)" with the macro
|
||||
"PtW32Catch", eg.
|
||||
"__PtW32Catch", eg.
|
||||
|
||||
#ifdef PtW32Catch
|
||||
PtW32Catch {
|
||||
#ifdef __PtW32Catch
|
||||
__PtW32Catch {
|
||||
...
|
||||
}
|
||||
#else
|
||||
@ -242,15 +235,15 @@ Other name changes
|
||||
All snapshots prior to and including snapshot 2000-08-13
|
||||
used "_pthread_" as the prefix to library internal
|
||||
functions, and "_PTHREAD_" to many library internal
|
||||
macros. These have now been changed to "ptw32_" and "PTW32_"
|
||||
macros. These have now been changed to "__ptw32_" and "__PTW32_"
|
||||
respectively so as to not conflict with the ANSI standard's
|
||||
reservation of identifiers beginning with "_" and "__" for
|
||||
use by compiler implementations only.
|
||||
|
||||
If you have written any applications and you are linking
|
||||
statically with the Pthreads4w library then you may have
|
||||
statically with the pthreads4w library then you may have
|
||||
included a call to _pthread_processInitialize. You will
|
||||
now have to change that to ptw32_processInitialize.
|
||||
now have to change that to __ptw32_processInitialize.
|
||||
|
||||
|
||||
Cleanup code default style
|
||||
@ -259,13 +252,13 @@ Cleanup code default style
|
||||
Previously, if not defined, the cleanup style was determined automatically
|
||||
from the compiler used, and one of the following was defined accordingly:
|
||||
|
||||
__CLEANUP_SEH MSVC only
|
||||
__CLEANUP_CXX C++, including MSVC++, GNU G++
|
||||
__CLEANUP_C C, including GNU GCC, not MSVC
|
||||
__PTW32_CLEANUP_SEH MSVC only
|
||||
__PTW32_CLEANUP_CXX C++, including MSVC++, GNU G++
|
||||
__PTW32_CLEANUP_C C, including GNU GCC, not MSVC
|
||||
|
||||
These defines determine the style of cleanup (see pthread.h) and,
|
||||
most importantly, the way that cancellation and thread exit (via
|
||||
pthread_exit) is performed (see the routine ptw32_throw()).
|
||||
pthread_exit) is performed (see the routine __ptw32_throw()).
|
||||
|
||||
In short, the exceptions versions of the library throw an exception
|
||||
when a thread is canceled, or exits via pthread_exit(). This exception is
|
||||
@ -274,24 +267,24 @@ the correct stack unwinding occurs regardless of where the thread
|
||||
is when it's canceled or exits via pthread_exit().
|
||||
|
||||
In this snapshot, unless the build explicitly defines (e.g. via a
|
||||
compiler option) __CLEANUP_SEH, __CLEANUP_CXX, or __CLEANUP_C, then
|
||||
the build NOW always defaults to __CLEANUP_C style cleanup. This style
|
||||
compiler option) __PTW32_CLEANUP_SEH, __PTW32_CLEANUP_CXX, or __PTW32_CLEANUP_C, then
|
||||
the build NOW always defaults to __PTW32_CLEANUP_C style cleanup. This style
|
||||
uses setjmp/longjmp in the cancellation and pthread_exit implementations,
|
||||
and therefore won't do stack unwinding even when linked to applications
|
||||
that have it (e.g. C++ apps). This is for consistency with most/all
|
||||
commercial Unix POSIX threads implementations.
|
||||
|
||||
Although it was not clearly documented before, it is still necessary to
|
||||
build your application using the same __CLEANUP_* define as was
|
||||
build your application using the same __PTW32_CLEANUP_* define as was
|
||||
used for the version of the library that you link with, so that the
|
||||
correct parts of pthread.h are included. That is, the possible
|
||||
defines require the following library versions:
|
||||
|
||||
__CLEANUP_SEH pthreadVSE.dll
|
||||
__CLEANUP_CXX pthreadVCE.dll or pthreadGCE.dll
|
||||
__CLEANUP_C pthreadVC.dll or pthreadGC.dll
|
||||
__PTW32_CLEANUP_SEH pthreadVSE.dll
|
||||
__PTW32_CLEANUP_CXX pthreadVCE.dll or pthreadGCE.dll
|
||||
__PTW32_CLEANUP_C pthreadVC.dll or pthreadGC.dll
|
||||
|
||||
It is recommended that you let pthread.h use it's default __CLEANUP_C
|
||||
It is recommended that you let pthread.h use it's default __PTW32_CLEANUP_C
|
||||
for both library and application builds. That is, don't define any of
|
||||
the above, and then link with pthreadVC.lib (MSVC or MSVC++) and
|
||||
libpthreadGC.a (MinGW GCC or G++). The reason is explained below, but
|
||||
@ -516,7 +509,7 @@ at the URL above).
|
||||
Building the library as a statically linkable library
|
||||
-----------------------------------------------------
|
||||
|
||||
General: PTW32_STATIC_LIB must be defined for both the library build and the
|
||||
General: __PTW32_STATIC_LIB must be defined for both the library build and the
|
||||
application build. The makefiles supplied and used by the following 'make'
|
||||
command lines will define this for you.
|
||||
|
||||
@ -529,7 +522,7 @@ MinGW32 (creates libpthreadGCn.a as a static link lib):
|
||||
|
||||
make clean GC-static
|
||||
|
||||
Define PTW32_STATIC_LIB also when building your application.
|
||||
Define __PTW32_STATIC_LIB also when building your application.
|
||||
|
||||
Building the library under Cygwin
|
||||
---------------------------------
|
||||
|
BIN
etc/deps/pthreads4w/bin/msvc-v141/pthreadVC3-i686.dll
Normal file
BIN
etc/deps/pthreads4w/bin/msvc-v141/pthreadVC3-i686.dll
Normal file
Binary file not shown.
BIN
etc/deps/pthreads4w/bin/msvc-v141/pthreadVC3-x64.dll
Normal file
BIN
etc/deps/pthreads4w/bin/msvc-v141/pthreadVC3-x64.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -3,13 +3,13 @@
|
||||
*
|
||||
* Purpose:
|
||||
* Pthreads4w internal macros, to be shared by other headers
|
||||
* comprising the Pthreads4w package.
|
||||
* comprising the pthreads4w package.
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads4w - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999-2018, Pthreads4w contributors
|
||||
* Pthreads4w - POSIX Threads for Windows
|
||||
* Copyright 1998 John E. Bossom
|
||||
* Copyright 1999-2018, Pthreads4w contributors
|
||||
*
|
||||
* Homepage: https://sourceforge.net/projects/pthreads4w/
|
||||
*
|
||||
@ -17,38 +17,39 @@
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
*
|
||||
* https://sourceforge.net/p/pthreads4w/wiki/Contributors/
|
||||
*
|
||||
* This file is part of Pthreads4w.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Pthreads4w is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Pthreads4w 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 General Public License for more details.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Pthreads4w. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef __PTW32_H
|
||||
#define __PTW32_H
|
||||
|
||||
/* See the README file for an explanation of the Pthreads4w
|
||||
/* See the README file for an explanation of the pthreads-win32
|
||||
* version numbering scheme and how the DLL is named etc.
|
||||
*
|
||||
* FIXME: consider moving this to <_ptw32.h>; maybe also add a
|
||||
* leading underscore to the macro names.
|
||||
*/
|
||||
#define PTW32_VERSION_MAJOR 2
|
||||
#define PTW32_VERSION_MINOR 11
|
||||
#define PTW32_VERSION_MICRO 0
|
||||
#define PTW32_VERION_BUILD 0
|
||||
#define PTW32_VERSION 2,11,0,0
|
||||
#define PTW32_VERSION_STRING "2, 11, 0, 0\0"
|
||||
#define __PTW32_VERSION_MAJOR 3
|
||||
#define __PTW32_VERSION_MINOR 0
|
||||
#define __PTW32_VERSION_MICRO 0
|
||||
#define __PTW32_VERION_BUILD 0
|
||||
#define __PTW32_VERSION 3,0,0,0
|
||||
#define __PTW32_VERSION_STRING "3, 0, 0, 0\0"
|
||||
|
||||
#if defined(__GNUC__) && !defined(__INTEL_LLVM_COMPILER)
|
||||
# pragma GCC system_header
|
||||
@ -65,16 +66,16 @@
|
||||
# define __PTW32_END_C_DECLS
|
||||
#endif
|
||||
|
||||
#if defined PTW32_STATIC_LIB
|
||||
# define PTW32_DLLPORT
|
||||
#if defined __PTW32_STATIC_LIB
|
||||
# define __PTW32_DLLPORT
|
||||
|
||||
#elif defined PTW32_BUILD
|
||||
# define PTW32_DLLPORT __declspec (dllexport)
|
||||
#elif defined __PTW32_BUILD
|
||||
# define __PTW32_DLLPORT __declspec (dllexport)
|
||||
#else
|
||||
# define PTW32_DLLPORT /*__declspec (dllimport)*/
|
||||
# define __PTW32_DLLPORT /*__declspec (dllimport)*/
|
||||
#endif
|
||||
|
||||
#ifndef PTW32_CDECL
|
||||
#ifndef __PTW32_CDECL
|
||||
/* FIXME: another internal macro; should have two initial underscores;
|
||||
* Nominally, we prefer to use __cdecl calling convention for all our
|
||||
* functions, but we map it through this macro alias to facilitate the
|
||||
@ -94,18 +95,18 @@
|
||||
* remember that this must be defined consistently, for both the DLL
|
||||
* build, and the application build.
|
||||
*/
|
||||
# define PTW32_CDECL
|
||||
# define __PTW32_CDECL
|
||||
# else
|
||||
# define PTW32_CDECL __cdecl
|
||||
# define __PTW32_CDECL __cdecl
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is more or less a duplicate of what is in the autoconf config.h,
|
||||
* which is only used when building the pthread-win32 libraries. They
|
||||
* which is only used when building the pthreads4w libraries.
|
||||
*/
|
||||
|
||||
#if !defined(PTW32_CONFIG_H) && !defined(__PTW32_PSEUDO_CONFIG_H_SOURCED)
|
||||
#if !defined (__PTW32_CONFIG_H) && !defined(__PTW32_PSEUDO_CONFIG_H_SOURCED)
|
||||
# define __PTW32_PSEUDO_CONFIG_H_SOURCED
|
||||
# if defined(WINCE)
|
||||
# undef HAVE_CPU_AFFINITY
|
||||
@ -121,9 +122,9 @@
|
||||
# if _MSC_VER >= 1900
|
||||
# define HAVE_STRUCT_TIMESPEC
|
||||
# elif _MSC_VER < 1300
|
||||
# define PTW32_CONFIG_MSVC6
|
||||
# define __PTW32_CONFIG_MSVC6
|
||||
# elif _MSC_VER < 1400
|
||||
# define PTW32_CONFIG_MSVC7
|
||||
# define __PTW32_CONFIG_MSVC7
|
||||
# endif
|
||||
# elif defined(_UWIN)
|
||||
# define HAVE_MODE_T
|
||||
@ -150,7 +151,7 @@
|
||||
#elif !defined(__MINGW32__)
|
||||
typedef _int64 int64_t;
|
||||
typedef unsigned _int64 uint64_t;
|
||||
# if defined(PTW32_CONFIG_MSVC6)
|
||||
# if defined (__PTW32_CONFIG_MSVC6)
|
||||
typedef long intptr_t;
|
||||
# endif
|
||||
#elif defined(HAVE_STDINT_H) && HAVE_STDINT_H == 1
|
||||
@ -195,11 +196,7 @@
|
||||
#endif
|
||||
|
||||
/* POSIX 2008 - related to robust mutexes */
|
||||
/*
|
||||
* FIXME: These should be changed for version 3.0.0 onward.
|
||||
* 42 clashes with EILSEQ.
|
||||
*/
|
||||
#if PTW32_VERSION_MAJOR > 2
|
||||
#if __PTW32_VERSION_MAJOR > 2
|
||||
# if !defined(EOWNERDEAD)
|
||||
# define EOWNERDEAD 1000
|
||||
# endif
|
||||
|
@ -2,9 +2,9 @@
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads4w - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999-2018, Pthreads4w contributors
|
||||
* Pthreads4w - POSIX Threads for Windows
|
||||
* Copyright 1998 John E. Bossom
|
||||
* Copyright 1999-2018, Pthreads4w contributors
|
||||
*
|
||||
* Homepage: https://sourceforge.net/projects/pthreads4w/
|
||||
*
|
||||
@ -12,22 +12,20 @@
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
*
|
||||
* https://sourceforge.net/p/pthreads4w/wiki/Contributors/
|
||||
*
|
||||
* This file is part of Pthreads4w.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Pthreads4w is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Pthreads4w 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Pthreads4w. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined( PTHREAD_H )
|
||||
@ -63,11 +61,11 @@
|
||||
* C++ apps). This is currently consistent with most/all commercial Unix
|
||||
* POSIX threads implementations.
|
||||
*/
|
||||
#if !defined( __CLEANUP_SEH ) && !defined( __CLEANUP_CXX ) && !defined( __CLEANUP_C )
|
||||
# define __CLEANUP_C
|
||||
#if !defined( __PTW32_CLEANUP_SEH ) && !defined( __PTW32_CLEANUP_CXX ) && !defined( __PTW32_CLEANUP_C )
|
||||
# define __PTW32_CLEANUP_C
|
||||
#endif
|
||||
|
||||
#if defined( __CLEANUP_SEH ) && ( !defined( _MSC_VER ) && !defined(PTW32_RC_MSC))
|
||||
#if defined( __PTW32_CLEANUP_SEH ) && ( !defined( _MSC_VER ) && !defined (__PTW32_RC_MSC))
|
||||
#error ERROR [__FILE__, line __LINE__]: SEH is not supported for this compiler.
|
||||
#endif
|
||||
|
||||
@ -166,14 +164,14 @@
|
||||
* The source code and other information about this library
|
||||
* are available from
|
||||
*
|
||||
* https://sourceforge.net/projects/pthreads4w//
|
||||
* https://sourceforge.net/projects/pthreads4w/
|
||||
*
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
enum
|
||||
{ /* Boolean values to make us independent of system includes. */
|
||||
PTW32_FALSE = 0,
|
||||
PTW32_TRUE = (! PTW32_FALSE)
|
||||
__PTW32_FALSE = 0,
|
||||
__PTW32_TRUE = (! __PTW32_FALSE)
|
||||
};
|
||||
|
||||
#include <time.h>
|
||||
@ -186,7 +184,7 @@ enum
|
||||
* =========================
|
||||
*
|
||||
* Options are normally set in <unistd.h>, which is not provided
|
||||
* with Pthreads4w.
|
||||
* with pthreads-win32.
|
||||
*
|
||||
* For conformance with the Single Unix Specification (version 3), all of the
|
||||
* options below are defined, and have a value of either -1 (not supported)
|
||||
@ -317,7 +315,7 @@ enum
|
||||
* ===========================
|
||||
*
|
||||
* These limits are normally set in <limits.h>, which is not provided with
|
||||
* Pthreads4w.
|
||||
* pthreads-win32.
|
||||
*
|
||||
* PTHREAD_DESTRUCTOR_ITERATIONS
|
||||
* Maximum number of attempts to destroy
|
||||
@ -391,20 +389,22 @@ enum
|
||||
* strictly comply with POSIX, e.g. not assume scalar type, only
|
||||
* compare pthread_t using the API function pthread_equal(), etc.
|
||||
*
|
||||
* Applications can use the element 'p' to compare, e.g. for sorting,
|
||||
* but it will be up to the application to determine if handles are
|
||||
* live or dead, or resurrected for an entirely new/different thread.
|
||||
* Non-conforming applications could use the element 'p' to compare,
|
||||
* e.g. for sorting, but it will be up to the application to determine
|
||||
* if handles are live or dead, or resurrected for an entirely
|
||||
* new/different thread. I.e. the thread is valid iff
|
||||
* x == p->ptHandle.x
|
||||
*/
|
||||
typedef struct
|
||||
{ void * p; /* Pointer to actual object */
|
||||
#if PTW32_VERSION_MAJOR > 2
|
||||
#if __PTW32_VERSION_MAJOR > 2
|
||||
size_t x; /* Extra information - reuse count etc */
|
||||
#else
|
||||
unsigned int x; /* Extra information - reuse count etc */
|
||||
#endif
|
||||
} ptw32_handle_t;
|
||||
} __ptw32_handle_t;
|
||||
|
||||
typedef ptw32_handle_t pthread_t;
|
||||
typedef __ptw32_handle_t pthread_t;
|
||||
typedef struct pthread_attr_t_ * pthread_attr_t;
|
||||
typedef struct pthread_once_t_ pthread_once_t;
|
||||
typedef struct pthread_key_t_ * pthread_key_t;
|
||||
@ -487,9 +487,9 @@ enum
|
||||
* ====================
|
||||
* ====================
|
||||
*/
|
||||
#if PTW32_VERSION_MAJOR > 2
|
||||
#if __PTW32_VERSION_MAJOR > 2
|
||||
|
||||
#define PTHREAD_ONCE_INIT { 0, PTW32_FALSE }
|
||||
#define PTHREAD_ONCE_INIT { 0, __PTW32_FALSE }
|
||||
|
||||
struct pthread_once_t_
|
||||
{
|
||||
@ -499,7 +499,7 @@ struct pthread_once_t_
|
||||
|
||||
#else
|
||||
|
||||
#define PTHREAD_ONCE_INIT { PTW32_FALSE, 0, 0, 0 }
|
||||
#define PTHREAD_ONCE_INIT { __PTW32_FALSE, 0, 0, 0 }
|
||||
|
||||
struct pthread_once_t_
|
||||
{
|
||||
@ -555,36 +555,36 @@ enum
|
||||
};
|
||||
|
||||
|
||||
typedef struct ptw32_cleanup_t ptw32_cleanup_t;
|
||||
typedef struct __ptw32_cleanup_t __ptw32_cleanup_t;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
/* Disable MSVC 'anachronism used' warning */
|
||||
#pragma warning( disable : 4229 )
|
||||
#endif
|
||||
|
||||
typedef void (* PTW32_CDECL ptw32_cleanup_callback_t)(void *);
|
||||
typedef void (* __PTW32_CDECL __ptw32_cleanup_callback_t)(void *);
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning( default : 4229 )
|
||||
#endif
|
||||
|
||||
struct ptw32_cleanup_t
|
||||
struct __ptw32_cleanup_t
|
||||
{
|
||||
ptw32_cleanup_callback_t routine;
|
||||
__ptw32_cleanup_callback_t routine;
|
||||
void *arg;
|
||||
struct ptw32_cleanup_t *prev;
|
||||
struct __ptw32_cleanup_t *prev;
|
||||
};
|
||||
|
||||
#if defined(__CLEANUP_SEH)
|
||||
#if defined(__PTW32_CLEANUP_SEH)
|
||||
/*
|
||||
* WIN32 SEH version of cancel cleanup.
|
||||
*/
|
||||
|
||||
#define pthread_cleanup_push( _rout, _arg ) \
|
||||
{ \
|
||||
ptw32_cleanup_t _cleanup; \
|
||||
__ptw32_cleanup_t _cleanup; \
|
||||
\
|
||||
_cleanup.routine = (ptw32_cleanup_callback_t)(_rout); \
|
||||
_cleanup.routine = (__ptw32_cleanup_callback_t)(_rout); \
|
||||
_cleanup.arg = (_arg); \
|
||||
__try \
|
||||
{ \
|
||||
@ -600,9 +600,9 @@ struct ptw32_cleanup_t
|
||||
} \
|
||||
}
|
||||
|
||||
#else /* __CLEANUP_SEH */
|
||||
#else /* __PTW32_CLEANUP_SEH */
|
||||
|
||||
#if defined(__CLEANUP_C)
|
||||
#if defined(__PTW32_CLEANUP_C)
|
||||
|
||||
/*
|
||||
* C implementation of PThreads cancel cleanup
|
||||
@ -610,17 +610,17 @@ struct ptw32_cleanup_t
|
||||
|
||||
#define pthread_cleanup_push( _rout, _arg ) \
|
||||
{ \
|
||||
ptw32_cleanup_t _cleanup; \
|
||||
__ptw32_cleanup_t _cleanup; \
|
||||
\
|
||||
ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t) (_rout), (_arg) ); \
|
||||
__ptw32_push_cleanup( &_cleanup, (__ptw32_cleanup_callback_t) (_rout), (_arg) ); \
|
||||
|
||||
#define pthread_cleanup_pop( _execute ) \
|
||||
(void) ptw32_pop_cleanup( _execute ); \
|
||||
(void) __ptw32_pop_cleanup( _execute ); \
|
||||
}
|
||||
|
||||
#else /* __CLEANUP_C */
|
||||
#else /* __PTW32_CLEANUP_C */
|
||||
|
||||
#if defined(__CLEANUP_CXX)
|
||||
#if defined(__PTW32_CLEANUP_CXX)
|
||||
|
||||
/*
|
||||
* C++ version of cancel cleanup.
|
||||
@ -640,7 +640,7 @@ struct ptw32_cleanup_t
|
||||
* of how the code exits the scope
|
||||
* (i.e. such as by an exception)
|
||||
*/
|
||||
ptw32_cleanup_callback_t cleanUpRout;
|
||||
__ptw32_cleanup_callback_t cleanUpRout;
|
||||
void * obj;
|
||||
int executeIt;
|
||||
|
||||
@ -656,7 +656,7 @@ struct ptw32_cleanup_t
|
||||
}
|
||||
|
||||
PThreadCleanup(
|
||||
ptw32_cleanup_callback_t routine,
|
||||
__ptw32_cleanup_callback_t routine,
|
||||
void * arg ) :
|
||||
cleanUpRout( routine ),
|
||||
obj( arg ),
|
||||
@ -689,7 +689,7 @@ struct ptw32_cleanup_t
|
||||
*/
|
||||
#define pthread_cleanup_push( _rout, _arg ) \
|
||||
{ \
|
||||
PThreadCleanup cleanup((ptw32_cleanup_callback_t)(_rout), \
|
||||
PThreadCleanup cleanup((__ptw32_cleanup_callback_t)(_rout), \
|
||||
(void *) (_arg) );
|
||||
|
||||
#define pthread_cleanup_pop( _execute ) \
|
||||
@ -700,11 +700,11 @@ struct ptw32_cleanup_t
|
||||
|
||||
#error ERROR [__FILE__, line __LINE__]: Cleanup type undefined.
|
||||
|
||||
#endif /* __CLEANUP_CXX */
|
||||
#endif /* __PTW32_CLEANUP_CXX */
|
||||
|
||||
#endif /* __CLEANUP_C */
|
||||
#endif /* __PTW32_CLEANUP_C */
|
||||
|
||||
#endif /* __CLEANUP_SEH */
|
||||
#endif /* __PTW32_CLEANUP_SEH */
|
||||
|
||||
|
||||
/*
|
||||
@ -720,275 +720,275 @@ __PTW32_BEGIN_C_DECLS
|
||||
/*
|
||||
* PThread Attribute Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_init (pthread_attr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_init (pthread_attr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_destroy (pthread_attr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_destroy (pthread_attr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getaffinity_np (const pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getaffinity_np (const pthread_attr_t * attr,
|
||||
size_t cpusetsize,
|
||||
cpu_set_t * cpuset);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getdetachstate (const pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getdetachstate (const pthread_attr_t * attr,
|
||||
int *detachstate);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstackaddr (const pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getstackaddr (const pthread_attr_t * attr,
|
||||
void **stackaddr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstacksize (const pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getstacksize (const pthread_attr_t * attr,
|
||||
size_t * stacksize);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setaffinity_np (pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setaffinity_np (pthread_attr_t * attr,
|
||||
size_t cpusetsize,
|
||||
const cpu_set_t * cpuset);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setdetachstate (pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setdetachstate (pthread_attr_t * attr,
|
||||
int detachstate);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstackaddr (pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setstackaddr (pthread_attr_t * attr,
|
||||
void *stackaddr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstacksize (pthread_attr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setstacksize (pthread_attr_t * attr,
|
||||
size_t stacksize);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedparam (const pthread_attr_t *attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getschedparam (const pthread_attr_t *attr,
|
||||
struct sched_param *param);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr,
|
||||
const struct sched_param *param);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *,
|
||||
int);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (const 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,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setinheritsched(pthread_attr_t * attr,
|
||||
int inheritsched);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(const 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 *,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setscope (pthread_attr_t *,
|
||||
int);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *,
|
||||
int *);
|
||||
|
||||
/*
|
||||
* PThread Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_create (pthread_t * tid,
|
||||
const pthread_attr_t * attr,
|
||||
void *(PTW32_CDECL *start) (void *),
|
||||
void * (__PTW32_CDECL *start) (void *),
|
||||
void *arg);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_detach (pthread_t tid);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_equal (pthread_t t1,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_equal (pthread_t t1,
|
||||
pthread_t t2);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL pthread_exit (void *value_ptr);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL pthread_exit (void *value_ptr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_join (pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_join (pthread_t thread,
|
||||
void **value_ptr);
|
||||
|
||||
PTW32_DLLPORT pthread_t PTW32_CDECL pthread_self (void);
|
||||
__PTW32_DLLPORT pthread_t __PTW32_CDECL pthread_self (void);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cancel (pthread_t thread);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_cancel (pthread_t thread);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setcancelstate (int state,
|
||||
int *oldstate);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setcanceltype (int type,
|
||||
int *oldtype);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL pthread_testcancel (void);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control,
|
||||
void (PTW32_CDECL *init_routine) (void));
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_once (pthread_once_t * once_control,
|
||||
void (__PTW32_CDECL *init_routine) (void));
|
||||
|
||||
#if __PTW32_LEVEL >= __PTW32_LEVEL_MAX
|
||||
PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute);
|
||||
__PTW32_DLLPORT __ptw32_cleanup_t * __PTW32_CDECL __ptw32_pop_cleanup (int execute);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
|
||||
ptw32_cleanup_callback_t routine,
|
||||
__PTW32_DLLPORT void __PTW32_CDECL __ptw32_push_cleanup (__ptw32_cleanup_t * cleanup,
|
||||
__ptw32_cleanup_callback_t routine,
|
||||
void *arg);
|
||||
#endif /* __PTW32_LEVEL >= __PTW32_LEVEL_MAX */
|
||||
|
||||
/*
|
||||
* Thread Specific Data Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key,
|
||||
void (PTW32_CDECL *destructor) (void *));
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_key_create (pthread_key_t * key,
|
||||
void (__PTW32_CDECL *destructor) (void *));
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_key_delete (pthread_key_t key);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setspecific (pthread_key_t key,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setspecific (pthread_key_t key,
|
||||
const void *value);
|
||||
|
||||
PTW32_DLLPORT void * PTW32_CDECL pthread_getspecific (pthread_key_t key);
|
||||
__PTW32_DLLPORT void * __PTW32_CDECL pthread_getspecific (pthread_key_t key);
|
||||
|
||||
|
||||
/*
|
||||
* Mutex Attribute Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_init (pthread_mutexattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_init (pthread_mutexattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_destroy (pthread_mutexattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_destroy (pthread_mutexattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getpshared (const pthread_mutexattr_t
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_getpshared (const pthread_mutexattr_t
|
||||
* attr,
|
||||
int *pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t * attr,
|
||||
int pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_settype (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_settype (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(
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_setrobust(
|
||||
pthread_mutexattr_t *attr,
|
||||
int robust);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getrobust(
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_getrobust(
|
||||
const pthread_mutexattr_t * attr,
|
||||
int * robust);
|
||||
|
||||
/*
|
||||
* Barrier Attribute Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_init (pthread_barrierattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrierattr_init (pthread_barrierattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_destroy (pthread_barrierattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrierattr_destroy (pthread_barrierattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_getpshared (const pthread_barrierattr_t
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrierattr_getpshared (const pthread_barrierattr_t
|
||||
* attr,
|
||||
int *pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_setpshared (pthread_barrierattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrierattr_setpshared (pthread_barrierattr_t * attr,
|
||||
int pshared);
|
||||
|
||||
/*
|
||||
* Mutex Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex,
|
||||
const pthread_mutexattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL 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);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL 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);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutex_consistent (pthread_mutex_t * mutex);
|
||||
|
||||
/*
|
||||
* Spinlock Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_init (pthread_spinlock_t * lock, int pshared);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_spin_init (pthread_spinlock_t * lock, int pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_destroy (pthread_spinlock_t * lock);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_spin_destroy (pthread_spinlock_t * lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_lock (pthread_spinlock_t * lock);
|
||||
__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_trylock (pthread_spinlock_t * lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock);
|
||||
|
||||
/*
|
||||
* Barrier Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_init (pthread_barrier_t * barrier,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrier_init (pthread_barrier_t * barrier,
|
||||
const pthread_barrierattr_t * attr,
|
||||
unsigned int count);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barrier);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barrier);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_barrier_wait (pthread_barrier_t * barrier);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_barrier_wait (pthread_barrier_t * barrier);
|
||||
|
||||
/*
|
||||
* Condition Variable Attribute Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_init (pthread_condattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_condattr_init (pthread_condattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_destroy (pthread_condattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_condattr_destroy (pthread_condattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_getpshared (const pthread_condattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_condattr_getpshared (const pthread_condattr_t * attr,
|
||||
int *pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_condattr_setpshared (pthread_condattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_condattr_setpshared (pthread_condattr_t * attr,
|
||||
int pshared);
|
||||
|
||||
/*
|
||||
* Condition Variable Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_init (pthread_cond_t * cond,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_cond_init (pthread_cond_t * cond,
|
||||
const pthread_condattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_destroy (pthread_cond_t * cond);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_cond_destroy (pthread_cond_t * cond);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_wait (pthread_cond_t * cond,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_cond_wait (pthread_cond_t * cond,
|
||||
pthread_mutex_t * mutex);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_timedwait (pthread_cond_t * cond,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_cond_timedwait (pthread_cond_t * cond,
|
||||
pthread_mutex_t * mutex,
|
||||
const struct timespec *abstime);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_cond_signal (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);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_cond_broadcast (pthread_cond_t * cond);
|
||||
|
||||
/*
|
||||
* Scheduling
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setschedparam (pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setschedparam (pthread_t thread,
|
||||
int policy,
|
||||
const struct sched_param *param);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_getschedparam (pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_getschedparam (pthread_t thread,
|
||||
int *policy,
|
||||
struct sched_param *param);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setconcurrency (int);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setconcurrency (int);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_getconcurrency (void);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_getconcurrency (void);
|
||||
|
||||
/*
|
||||
* Read-Write Lock Functions
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_init(pthread_rwlock_t *lock,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_init(pthread_rwlock_t *lock,
|
||||
const pthread_rwlockattr_t *attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_destroy(pthread_rwlock_t *lock);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_destroy(pthread_rwlock_t *lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_tryrdlock(pthread_rwlock_t *);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_tryrdlock(pthread_rwlock_t *);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_trywrlock(pthread_rwlock_t *);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_trywrlock(pthread_rwlock_t *);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_rdlock(pthread_rwlock_t *lock);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_rdlock(pthread_rwlock_t *lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedrdlock(pthread_rwlock_t *lock,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_timedrdlock(pthread_rwlock_t *lock,
|
||||
const struct timespec *abstime);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_wrlock(pthread_rwlock_t *lock);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_wrlock(pthread_rwlock_t *lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedwrlock(pthread_rwlock_t *lock,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_timedwrlock(pthread_rwlock_t *lock,
|
||||
const struct timespec *abstime);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_unlock(pthread_rwlock_t *lock);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlock_unlock(pthread_rwlock_t *lock);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_init (pthread_rwlockattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlockattr_init (pthread_rwlockattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr,
|
||||
int *pshared);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr,
|
||||
int pshared);
|
||||
|
||||
#if __PTW32_LEVEL >= __PTW32_LEVEL_MAX - 1
|
||||
@ -997,7 +997,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_
|
||||
* Signal Functions. Should be defined in <signal.h> but MSVC and MinGW32
|
||||
* already have signal.h that don't define these.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_kill(pthread_t thread, int sig);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_kill(pthread_t thread, int sig);
|
||||
|
||||
/*
|
||||
* Non-portable functions
|
||||
@ -1006,55 +1006,55 @@ PTW32_DLLPORT int PTW32_CDECL pthread_kill(pthread_t thread, int sig);
|
||||
/*
|
||||
* Compatibility with Linux.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr,
|
||||
int kind);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr,
|
||||
int *kind);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_timedjoin_np(pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_timedjoin_np(pthread_t thread,
|
||||
void **value_ptr,
|
||||
const struct timespec *abstime);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_tryjoin_np(pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_tryjoin_np(pthread_t thread,
|
||||
void **value_ptr);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setaffinity_np(pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setaffinity_np(pthread_t thread,
|
||||
size_t cpusetsize,
|
||||
const cpu_set_t *cpuset);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_getaffinity_np(pthread_t thread,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_getaffinity_np(pthread_t thread,
|
||||
size_t cpusetsize,
|
||||
cpu_set_t *cpuset);
|
||||
|
||||
/*
|
||||
* Possibly supported by other POSIX threads implementations
|
||||
*/
|
||||
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);
|
||||
__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
|
||||
* the lib rather than load the DLL at run-time.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_win32_process_attach_np(void);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_win32_process_detach_np(void);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_win32_thread_attach_np(void);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_win32_thread_detach_np(void);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_win32_process_attach_np(void);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_win32_process_detach_np(void);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_win32_thread_attach_np(void);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_win32_thread_detach_np(void);
|
||||
|
||||
/*
|
||||
* Returns the first parameter "abstime" modified to represent the current system time.
|
||||
* If "relative" is not NULL it represents an interval to add to "abstime".
|
||||
*/
|
||||
|
||||
PTW32_DLLPORT struct timespec * PTW32_CDECL pthread_win32_getabstime_np(
|
||||
__PTW32_DLLPORT struct timespec * __PTW32_CDECL pthread_win32_getabstime_np(
|
||||
struct timespec * abstime,
|
||||
const struct timespec * relative);
|
||||
|
||||
/*
|
||||
* Features that are auto-detected at load/run time.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_win32_test_features_np(int);
|
||||
enum ptw32_features
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_win32_test_features_np(int);
|
||||
enum __ptw32_features
|
||||
{
|
||||
PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */
|
||||
PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */
|
||||
__PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */
|
||||
__PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1065,7 +1065,7 @@ enum ptw32_features
|
||||
* WM_TIMECHANGE message. It can be passed directly to
|
||||
* pthread_create() as a new thread if desired.
|
||||
*/
|
||||
PTW32_DLLPORT void * PTW32_CDECL pthread_timechange_handler_np(void *);
|
||||
__PTW32_DLLPORT void * __PTW32_CDECL pthread_timechange_handler_np(void *);
|
||||
|
||||
#endif /* __PTW32_LEVEL >= __PTW32_LEVEL_MAX - 1 */
|
||||
|
||||
@ -1074,27 +1074,27 @@ PTW32_DLLPORT void * PTW32_CDECL pthread_timechange_handler_np(void *);
|
||||
/*
|
||||
* Returns the Win32 HANDLE for the POSIX thread.
|
||||
*/
|
||||
PTW32_DLLPORT void * PTW32_CDECL pthread_getw32threadhandle_np(pthread_t thread);
|
||||
__PTW32_DLLPORT void * __PTW32_CDECL pthread_getw32threadhandle_np(pthread_t thread);
|
||||
/*
|
||||
* Returns the win32 thread ID for POSIX thread.
|
||||
*/
|
||||
PTW32_DLLPORT unsigned long PTW32_CDECL pthread_getw32threadid_np (pthread_t thread);
|
||||
__PTW32_DLLPORT unsigned long __PTW32_CDECL pthread_getw32threadid_np (pthread_t thread);
|
||||
|
||||
/*
|
||||
* Sets the POSIX thread name. If _MSC_VER is defined the name should be displayed by
|
||||
* the MSVS debugger.
|
||||
*/
|
||||
#if defined(PTW32_COMPATIBILITY_BSD) || defined(PTW32_COMPATIBILITY_TRU64)
|
||||
#if defined (__PTW32_COMPATIBILITY_BSD) || defined (__PTW32_COMPATIBILITY_TRU64)
|
||||
#define PTHREAD_MAX_NAMELEN_NP 16
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setname_np (pthread_t thr, const char * name, void * arg);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setname_np (pthread_attr_t * attr, const char * name, void * arg);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setname_np (pthread_t thr, const char * name, void * arg);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setname_np (pthread_attr_t * attr, const char * name, void * arg);
|
||||
#else
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_setname_np (pthread_t thr, const char * name);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_setname_np (pthread_attr_t * attr, const char * name);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_setname_np (pthread_t thr, const char * name);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_setname_np (pthread_attr_t * attr, const char * name);
|
||||
#endif
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_getname_np (pthread_t thr, char * name, int len);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthread_attr_getname_np (pthread_attr_t * attr, char * name, int len);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_getname_np (pthread_t thr, char * name, int len);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthread_attr_getname_np (pthread_attr_t * attr, char * name, int len);
|
||||
|
||||
|
||||
/*
|
||||
@ -1112,8 +1112,8 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_getname_np (pthread_attr_t * attr, ch
|
||||
* argument to TimedWait is simply passed to
|
||||
* WaitForMultipleObjects.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL pthreadCancelableWait (void *waitHandle);
|
||||
PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (void *waitHandle,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthreadCancelableWait (void *waitHandle);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL pthreadCancelableTimedWait (void *waitHandle,
|
||||
unsigned long timeout);
|
||||
|
||||
#endif /* __PTW32_LEVEL >= __PTW32_LEVEL_MAX */
|
||||
@ -1129,9 +1129,9 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (void *waitHandle,
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(PTW32_USES_SEPARATE_CRT) && (defined(__CLEANUP_CXX) || defined(__CLEANUP_SEH))
|
||||
typedef void (*ptw32_terminate_handler)();
|
||||
PTW32_DLLPORT ptw32_terminate_handler PTW32_CDECL pthread_win32_set_terminate_np(ptw32_terminate_handler termFunction);
|
||||
#if defined (__PTW32_USES_SEPARATE_CRT) && (defined(__PTW32_CLEANUP_CXX) || defined(__PTW32_CLEANUP_SEH))
|
||||
typedef void (*__ptw32_terminate_handler)();
|
||||
__PTW32_DLLPORT __ptw32_terminate_handler __PTW32_CDECL pthread_win32_set_terminate_np(__ptw32_terminate_handler termFunction);
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
@ -1139,9 +1139,9 @@ PTW32_DLLPORT ptw32_terminate_handler PTW32_CDECL pthread_win32_set_terminate_np
|
||||
/*
|
||||
* Internal exceptions
|
||||
*/
|
||||
class ptw32_exception {};
|
||||
class ptw32_exception_cancel : public ptw32_exception {};
|
||||
class ptw32_exception_exit : public ptw32_exception {};
|
||||
class __ptw32_exception {};
|
||||
class __ptw32_exception_cancel : public __ptw32_exception {};
|
||||
class __ptw32_exception_exit : public __ptw32_exception {};
|
||||
|
||||
#endif
|
||||
|
||||
@ -1151,25 +1151,25 @@ class ptw32_exception_exit : public ptw32_exception {};
|
||||
/*
|
||||
* Get internal SEH tag
|
||||
*/
|
||||
PTW32_DLLPORT unsigned long PTW32_CDECL ptw32_get_exception_services_code(void);
|
||||
__PTW32_DLLPORT unsigned long __PTW32_CDECL __ptw32_get_exception_services_code(void);
|
||||
|
||||
#endif /* __PTW32_LEVEL >= __PTW32_LEVEL_MAX */
|
||||
|
||||
#if !defined(PTW32_BUILD)
|
||||
#if !defined (__PTW32_BUILD)
|
||||
|
||||
#if defined(__CLEANUP_SEH)
|
||||
#if defined(__PTW32_CLEANUP_SEH)
|
||||
|
||||
/*
|
||||
* Redefine the SEH __except keyword to ensure that applications
|
||||
* propagate our internal exceptions up to the library's internal handlers.
|
||||
*/
|
||||
#define __except( E ) \
|
||||
__except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \
|
||||
__except( ( GetExceptionCode() == __ptw32_get_exception_services_code() ) \
|
||||
? EXCEPTION_CONTINUE_SEARCH : ( E ) )
|
||||
|
||||
#endif /* __CLEANUP_SEH */
|
||||
#endif /* __PTW32_CLEANUP_SEH */
|
||||
|
||||
#if defined(__CLEANUP_CXX)
|
||||
#if defined(__PTW32_CLEANUP_CXX)
|
||||
|
||||
/*
|
||||
* Redefine the C++ catch keyword to ensure that applications
|
||||
@ -1177,21 +1177,21 @@ PTW32_DLLPORT unsigned long PTW32_CDECL ptw32_get_exception_services_code(void);
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
/*
|
||||
* WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll'
|
||||
* WARNING: Replace any 'catch( ... )' with '__PtW32CatchAll'
|
||||
* if you want Pthread-Win32 cancellation and pthread_exit to work.
|
||||
*/
|
||||
|
||||
#if !defined(PtW32NoCatchWarn)
|
||||
#if !defined(__PtW32NoCatchWarn)
|
||||
|
||||
#pragma message("Specify \"/DPtW32NoCatchWarn\" compiler flag to skip this message.")
|
||||
#pragma message("Specify \"/D__PtW32NoCatchWarn\" compiler flag to skip this message.")
|
||||
#pragma message("------------------------------------------------------------------")
|
||||
#pragma message("When compiling applications with MSVC++ and C++ exception handling:")
|
||||
#pragma message(" Replace any 'catch( ... )' in routines called from POSIX threads")
|
||||
#pragma message(" with 'PtW32CatchAll' or 'CATCHALL' if you want POSIX thread")
|
||||
#pragma message(" with '__PtW32CatchAll' or 'CATCHALL' if you want POSIX thread")
|
||||
#pragma message(" cancellation and pthread_exit to work. For example:")
|
||||
#pragma message("")
|
||||
#pragma message(" #if defined(PtW32CatchAll)")
|
||||
#pragma message(" PtW32CatchAll")
|
||||
#pragma message(" #if defined(__PtW32CatchAll)")
|
||||
#pragma message(" __PtW32CatchAll")
|
||||
#pragma message(" #else")
|
||||
#pragma message(" catch(...)")
|
||||
#pragma message(" #endif")
|
||||
@ -1202,21 +1202,21 @@ PTW32_DLLPORT unsigned long PTW32_CDECL ptw32_get_exception_services_code(void);
|
||||
|
||||
#endif
|
||||
|
||||
#define PtW32CatchAll \
|
||||
catch( ptw32_exception & ) { throw; } \
|
||||
#define __PtW32CatchAll \
|
||||
catch( __ptw32_exception & ) { throw; } \
|
||||
catch( ... )
|
||||
|
||||
#else /* _MSC_VER */
|
||||
|
||||
#define catch( E ) \
|
||||
catch( ptw32_exception & ) { throw; } \
|
||||
catch( __ptw32_exception & ) { throw; } \
|
||||
catch( E )
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#endif /* __CLEANUP_CXX */
|
||||
#endif /* __PTW32_CLEANUP_CXX */
|
||||
|
||||
#endif /* ! PTW32_BUILD */
|
||||
#endif /* ! __PTW32_BUILD */
|
||||
|
||||
__PTW32_END_C_DECLS
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads4w - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999-2018, Pthreads4w contributors
|
||||
* Pthreads4w - POSIX Threads for Windows
|
||||
* Copyright 1998 John E. Bossom
|
||||
* Copyright 1999-2018, Pthreads4w contributors
|
||||
*
|
||||
* Homepage: https://sourceforge.net/projects/pthreads4w/
|
||||
*
|
||||
@ -19,22 +19,20 @@
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
*
|
||||
* https://sourceforge.net/p/pthreads4w/wiki/Contributors/
|
||||
*
|
||||
* This file is part of Pthreads4w.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Pthreads4w is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Pthreads4w 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Pthreads4w. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#if !defined(_SCHED_H)
|
||||
#define _SCHED_H
|
||||
@ -106,7 +104,7 @@ struct timespec
|
||||
/*
|
||||
* Microsoft VC++6.0 lacks these *_PTR types
|
||||
*/
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1300 && !defined(PTW32_HAVE_DWORD_PTR)
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1300 && !defined (__PTW32_HAVE_DWORD_PTR)
|
||||
typedef unsigned long ULONG_PTR;
|
||||
typedef ULONG_PTR DWORD_PTR;
|
||||
#endif
|
||||
@ -165,16 +163,16 @@ typedef union
|
||||
|
||||
__PTW32_BEGIN_C_DECLS
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sched_yield (void);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sched_yield (void);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sched_get_priority_min (int policy);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sched_get_priority_min (int policy);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sched_get_priority_max (int policy);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sched_get_priority_max (int policy);
|
||||
|
||||
/* FIXME: this declaration of sched_setscheduler() is NOT as prescribed
|
||||
* by POSIX; it lacks const struct sched_param * as third argument.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL sched_setscheduler (pid_t pid, int policy);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sched_setscheduler (pid_t pid, int policy);
|
||||
|
||||
/* FIXME: In addition to the above five functions, POSIX also requires:
|
||||
*
|
||||
@ -187,30 +185,30 @@ PTW32_DLLPORT int PTW32_CDECL sched_setscheduler (pid_t pid, int policy);
|
||||
/* Compatibility with Linux - not standard in POSIX
|
||||
* FIXME: consider occluding within a _GNU_SOURCE (or similar) feature test.
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL sched_setaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *mask);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sched_setaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *mask);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sched_getaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *mask);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sched_getaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *mask);
|
||||
|
||||
/*
|
||||
* Support routines and macros for cpu_set_t
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL _sched_affinitycpucount (const cpu_set_t *set);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL _sched_affinitycpucount (const cpu_set_t *set);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL _sched_affinitycpuzero (cpu_set_t *pset);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL _sched_affinitycpuzero (cpu_set_t *pset);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL _sched_affinitycpuset (int cpu, cpu_set_t *pset);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL _sched_affinitycpuset (int cpu, cpu_set_t *pset);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL _sched_affinitycpuclr (int cpu, cpu_set_t *pset);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL _sched_affinitycpuclr (int cpu, cpu_set_t *pset);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL _sched_affinitycpuisset (int cpu, const cpu_set_t *pset);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL _sched_affinitycpuisset (int cpu, const cpu_set_t *pset);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL _sched_affinitycpuand(cpu_set_t *pdestset, const cpu_set_t *psrcset1, const cpu_set_t *psrcset2);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL _sched_affinitycpuand(cpu_set_t *pdestset, const cpu_set_t *psrcset1, const cpu_set_t *psrcset2);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL _sched_affinitycpuor(cpu_set_t *pdestset, const cpu_set_t *psrcset1, const cpu_set_t *psrcset2);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL _sched_affinitycpuor(cpu_set_t *pdestset, const cpu_set_t *psrcset1, const cpu_set_t *psrcset2);
|
||||
|
||||
PTW32_DLLPORT void PTW32_CDECL _sched_affinitycpuxor(cpu_set_t *pdestset, const cpu_set_t *psrcset1, const cpu_set_t *psrcset2);
|
||||
__PTW32_DLLPORT void __PTW32_CDECL _sched_affinitycpuxor(cpu_set_t *pdestset, const cpu_set_t *psrcset1, const cpu_set_t *psrcset2);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL _sched_affinitycpuequal (const cpu_set_t *pset1, const cpu_set_t *pset2);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL _sched_affinitycpuequal (const cpu_set_t *pset1, const cpu_set_t *pset2);
|
||||
|
||||
/* Note that this macro returns ENOTSUP rather than ENOSYS, as
|
||||
* might be expected. However, returning ENOSYS should mean that
|
||||
|
@ -9,9 +9,9 @@
|
||||
*
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* Pthreads4w - POSIX Threads Library for Win32
|
||||
* Copyright(C) 1998 John E. Bossom
|
||||
* Copyright(C) 1999-2018, Pthreads4w contributors
|
||||
* Pthreads4w - POSIX Threads for Windows
|
||||
* Copyright 1998 John E. Bossom
|
||||
* Copyright 1999-2018, Pthreads4w contributors
|
||||
*
|
||||
* Homepage: https://sourceforge.net/projects/pthreads4w/
|
||||
*
|
||||
@ -19,22 +19,20 @@
|
||||
* in the file CONTRIBUTORS included with the source
|
||||
* code distribution. The list can also be seen at the
|
||||
* following World Wide Web location:
|
||||
*
|
||||
* https://sourceforge.net/p/pthreads4w/wiki/Contributors/
|
||||
*
|
||||
* This file is part of Pthreads4w.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Pthreads4w is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Pthreads4w 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Pthreads4w. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#if !defined( SEMAPHORE_H )
|
||||
#define SEMAPHORE_H
|
||||
@ -54,7 +52,7 @@
|
||||
#define _POSIX_SEMAPHORES
|
||||
|
||||
/* Internal macros, common to the public interfaces for various
|
||||
* Pthreads4w components, are defined in <_ptw32.h>; we must
|
||||
* pthreads-win32 components, are defined in <_ptw32.h>; we must
|
||||
* include them here.
|
||||
*/
|
||||
#include <_ptw32.h>
|
||||
@ -86,31 +84,31 @@ __PTW32_BEGIN_C_DECLS
|
||||
/* Function prototypes: some are implemented as stubs, which
|
||||
* always fail; (FIXME: identify them).
|
||||
*/
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_init (sem_t * sem,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_init (sem_t * sem,
|
||||
int pshared,
|
||||
unsigned int value);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_destroy (sem_t * sem);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_destroy (sem_t * sem);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_trywait (sem_t * sem);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_trywait (sem_t * sem);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_wait (sem_t * sem);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_wait (sem_t * sem);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_timedwait (sem_t * sem,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_timedwait (sem_t * sem,
|
||||
const struct timespec * abstime);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_post (sem_t * sem);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_post (sem_t * sem);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_post_multiple (sem_t * sem,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_post_multiple (sem_t * sem,
|
||||
int count);
|
||||
|
||||
PTW32_DLLPORT sem_t * PTW32_CDECL sem_open (const char *, int, ...);
|
||||
__PTW32_DLLPORT sem_t * __PTW32_CDECL sem_open (const char *, int, ...);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_close (sem_t * sem);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_close (sem_t * sem);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_unlink (const char * name);
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_unlink (const char * name);
|
||||
|
||||
PTW32_DLLPORT int PTW32_CDECL sem_getvalue (sem_t * sem,
|
||||
__PTW32_DLLPORT int __PTW32_CDECL sem_getvalue (sem_t * sem,
|
||||
int * sval);
|
||||
|
||||
__PTW32_END_C_DECLS
|
||||
|
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/i686/pthreadVC3.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/i686/pthreadVC3.lib
Normal file
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/i686/pthreadVC3d.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/i686/pthreadVC3d.lib
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/x64/pthreadVC3.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/x64/pthreadVC3.lib
Normal file
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/x64/pthreadVC3d.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/shared/x64/pthreadVC3d.lib
Normal file
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/i686/libpthreadVC3.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/i686/libpthreadVC3.lib
Normal file
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/i686/libpthreadVC3d.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/i686/libpthreadVC3d.lib
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/x64/libpthreadVC3.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/x64/libpthreadVC3.lib
Normal file
Binary file not shown.
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/x64/libpthreadVC3d.lib
Normal file
BIN
etc/deps/pthreads4w/lib/msvc-v141/static/x64/libpthreadVC3d.lib
Normal file
Binary file not shown.
@ -226,8 +226,8 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<MinimumRequiredVersion>5.1</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC2-i686d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static\i686;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC3d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -257,8 +257,8 @@
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<MinimumRequiredVersion>5.1</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC2-i686.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static\i686;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_SSE2|Win32'">
|
||||
@ -288,8 +288,8 @@
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<MinimumRequiredVersion>5.1</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC2-i686.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static\i686;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|Win32'">
|
||||
@ -336,8 +336,8 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<MinimumRequiredVersion>5.2</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC2-x64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC3d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@ -367,8 +367,8 @@
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<MinimumRequiredVersion>5.2</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC2-x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_SSE2|x64'">
|
||||
@ -398,8 +398,8 @@
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<MinimumRequiredVersion>5.2</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC2-x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\static\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_DLL|x64'">
|
||||
|
@ -305,9 +305,13 @@
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>pthreadVC2-i686.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\shared\i686;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>pthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y /B "$(ProjectDir)..\etc\deps\pthreads4w\bin\msvc-v141\pthreadVC3-i686.dll" "$(TargetDir)"</Command>
|
||||
<Message>Copy DLL dependencies...</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
@ -418,9 +422,15 @@
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\shared;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>pthreadVC2-x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\etc\deps\pthreads4w\lib\msvc-v141\shared\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>pthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /Y /B "$(ProjectDir)..\etc\deps\pthreads4w\bin\msvc-v141\pthreadVC3-x64.dll" "$(TargetDir)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy DLL dependencies...</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <sched.h>
|
||||
|
||||
/* Platform */
|
||||
#if defined(__linux__) || defined(PTW32_VERSION) || defined(__CYGWIN__)
|
||||
#if defined(__linux__) || defined(__PTW32_VERSION) || defined(__CYGWIN__)
|
||||
# define HAVE_SCHED_GETAFFINITY 1
|
||||
#elif defined(_WIN32)
|
||||
# define WIN32_LEAN_AND_MEAN 1
|
||||
|
Loading…
Reference in New Issue
Block a user