1 /* 2 * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk. 3 * All Rights Reserved. 4 * 5 * Portions created by Michael Steinert are Copyright (c) 2012-2013 Michael 6 * Steinert. All Rights Reserved. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a 9 * copy of this software and associated documentation files (the "Software"), 10 * to deal in the Software without restriction, including without limitation 11 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * and/or sell copies of the Software, and to permit persons to whom the 13 * Software is furnished to do so, subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included in 16 * all copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 * DEALINGS IN THE SOFTWARE. 25 */ 26 27 #ifndef AMQP_THREAD_H 28 #define AMQP_THREAD_H 29 30 #if !defined(WINVER) || defined(__MINGW32__) || defined(__MINGW64__) 31 #ifdef WINVER 32 #undef WINVER 33 #endif 34 /* Windows Vista or newer */ 35 #define WINVER 0x0600 36 #endif 37 #ifndef WIN32_LEAN_AND_MEAN 38 #define WIN32_LEAN_AND_MEAN 39 #endif 40 #include <windows.h> 41 42 typedef SRWLOCK pthread_mutex_t; 43 #define PTHREAD_MUTEX_INITIALIZER SRWLOCK_INIT; 44 45 DWORD pthread_self(void); 46 47 int pthread_mutex_init(pthread_mutex_t *, void *attr); 48 int pthread_mutex_lock(pthread_mutex_t *); 49 int pthread_mutex_unlock(pthread_mutex_t *); 50 int pthread_mutex_destroy(pthread_mutex_t *); 51 52 #endif /* AMQP_THREAD_H */ 53