]>
Commit | Line | Data |
---|---|---|
32938903 AM |
1 | #! /bin/sh /usr/share/dpatch/dpatch-run |
2 | ## 005_fix-pthreads-detect.dpatch by <divanov@creditreform.bg> | |
3 | ## | |
4 | ## All lines beginning with `## DP:' are a description of the patch. | |
5 | ## DP: Fix pthreads detection | |
6 | ||
7 | @DPATCH@ | |
8 | ||
9 | --- firebird2-1.5.2.orig/src/common/classes/locks.h | |
10 | +++ firebird2-1.5.2/src/common/classes/locks.h | |
11 | @@ -29,24 +29,22 @@ | |
12 | #include "firebird.h" | |
13 | ||
14 | #ifdef MULTI_THREAD | |
15 | -#ifdef WIN_NT | |
16 | +#if defined(WIN_NT) | |
17 | // It is relatively easy to avoid using this header. Maybe do the same stuff like | |
18 | // in thd.h ? This is Windows platform maintainers choice | |
19 | #include <windows.h> | |
20 | -#else | |
21 | -#ifndef SOLARIS | |
22 | -#include <pthread.h> | |
23 | -#else | |
24 | +#elif defined(SOLARIS) | |
25 | #include <thread.h> | |
26 | #include <synch.h> | |
27 | -#endif | |
28 | +#else | |
29 | +#include <pthread.h> | |
30 | #endif | |
31 | #endif /* MULTI_THREAD */ | |
32 | ||
33 | namespace Firebird { | |
34 | ||
35 | #ifdef MULTI_THREAD | |
36 | -#ifdef WIN_NT | |
37 | +#if defined(WIN_NT) | |
38 | ||
39 | /* Process-local spinlock. Used to manage memory heaps in threaded environment. */ | |
40 | // Windows version of the class | |
41 | @@ -77,7 +75,7 @@ | |
42 | ||
43 | /* Process-local spinlock. Used to manage memory heaps in threaded environment. */ | |
44 | // Pthreads version of the class | |
45 | -#if !defined(SOLARIS) && !defined(DARWIN) && !defined(FREEBSD) | |
46 | +#if !defined(SOLARIS) && !defined(DARWIN) && !defined(FREEBSD) && !defined(_POSIX_THREAD_IS_GNU_PTH) | |
47 | class Spinlock { | |
48 | private: | |
49 | pthread_spinlock_t spinlock; | |
50 | @@ -124,7 +122,7 @@ | |
51 | system_call_failed::raise(); | |
52 | } | |
53 | }; | |
54 | -#else // DARWIN and FREEBSD | |
55 | +#else // DARWIN, FREEBSD and gnu pth | |
56 | class Spinlock { | |
57 | private: | |
58 | pthread_mutex_t mlock; |