File: pthread_compat.h

package info (click to toggle)
mosquitto 2.0.22-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,556 kB
  • sloc: ansic: 51,107; python: 15,095; xml: 7,187; makefile: 1,819; cpp: 1,541; sh: 305; perl: 70
file content (28 lines) | stat: -rw-r--r-- 988 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef PTHREAD_COMPAT_
#define PTHREAD_COMPAT_

#if defined(WITH_THREADING) && !defined(WITH_BROKER)
#  include <pthread.h>

#  define COMPAT_pthread_create(A, B, C, D) pthread_create((A), (B), (C), (D))
#  define COMPAT_pthread_join(A, B) pthread_join((A), (B))
#  define COMPAT_pthread_cancel(A) pthread_cancel((A))
#  define COMPAT_pthread_testcancel() pthread_testcancel()

#  define COMPAT_pthread_mutex_init(A, B) pthread_mutex_init((A), (B))
#  define COMPAT_pthread_mutex_destroy(A) pthread_mutex_destroy((A))
#  define COMPAT_pthread_mutex_lock(A) pthread_mutex_lock((A))
#  define COMPAT_pthread_mutex_unlock(A) pthread_mutex_unlock((A))
#else
#  define COMPAT_pthread_create(A, B, C, D)
#  define COMPAT_pthread_join(A, B)
#  define COMPAT_pthread_cancel(A)
#  define COMPAT_pthread_testcancel()

#  define COMPAT_pthread_mutex_init(A, B)
#  define COMPAT_pthread_mutex_destroy(A)
#  define COMPAT_pthread_mutex_lock(A)
#  define COMPAT_pthread_mutex_unlock(A)
#endif

#endif