curl_threads.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_THREADS_H
00002 #define HEADER_CURL_THREADS_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 #include "curl_setup.h"
00025 
00026 #if defined(USE_THREADS_POSIX)
00027 #  define CURL_STDCALL
00028 #  define curl_mutex_t           pthread_mutex_t
00029 #  define curl_thread_t          pthread_t *
00030 #  define curl_thread_t_null     (pthread_t *)0
00031 #  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
00032 #  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
00033 #  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
00034 #  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
00035 #elif defined(USE_THREADS_WIN32)
00036 #  define CURL_STDCALL           __stdcall
00037 #  define curl_mutex_t           CRITICAL_SECTION
00038 #  define curl_thread_t          HANDLE
00039 #  define curl_thread_t_null     (HANDLE)0
00040 #  if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_VISTA) || \
00041       (_WIN32_WINNT < _WIN32_WINNT_VISTA)
00042 #    define Curl_mutex_init(m)   InitializeCriticalSection(m)
00043 #  else
00044 #    define Curl_mutex_init(m)   InitializeCriticalSectionEx(m, 0, 1)
00045 #  endif
00046 #  define Curl_mutex_acquire(m)  EnterCriticalSection(m)
00047 #  define Curl_mutex_release(m)  LeaveCriticalSection(m)
00048 #  define Curl_mutex_destroy(m)  DeleteCriticalSection(m)
00049 #endif
00050 
00051 #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
00052 
00053 /* !checksrc! disable SPACEBEFOREPAREN 1 */
00054 curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *),
00055                                  void *arg);
00056 
00057 void Curl_thread_destroy(curl_thread_t hnd);
00058 
00059 int Curl_thread_join(curl_thread_t *hnd);
00060 
00061 #endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */
00062 
00063 #endif /* HEADER_CURL_THREADS_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02