libsoup3: update to 3.6.0; fix GTK2/3 app startup
[oi-userland.git] / components / network / ntp / patches / 98-recvbuff.patch
blob098a6cae67ecfb86c65e690f3193d04c9f4af0aa
1 There is code in recvbuff.c which adds a mutex around these structures but only on Windows.
2 Given that the OpenIndiana build of ntpd is sporadically multithreaded we also seem to need
3 a pthreads mutex to protect the critical section.
4 --- libntp/recvbuff.c.orig
5 +++ libntp/recvbuff.c
6 @@ -50,11 +50,23 @@
7 # define LOCK_F() EnterCriticalSection(&FreeLock)
8 # define UNLOCK_F() LeaveCriticalSection(&FreeLock)
9 #else
10 +#if defined(HAVE_SOLARIS_PRIVS)
12 +static pthread_mutex_t RecvLock = PTHREAD_MUTEX_INITIALIZER;
13 +static pthread_mutex_t FreeLock = PTHREAD_MUTEX_INITIALIZER;
15 +# define LOCK_R() pthread_mutex_lock(&RecvLock);
16 +# define UNLOCK_R() pthread_mutex_unlock(&RecvLock);
17 +# define LOCK_F() pthread_mutex_lock(&FreeLock);
18 +# define UNLOCK_F() pthread_mutex_unlock(&FreeLock);
20 +#else
21 # define LOCK_R() do {} while (FALSE)
22 # define UNLOCK_R() do {} while (FALSE)
23 # define LOCK_F() do {} while (FALSE)
24 # define UNLOCK_F() do {} while (FALSE)
25 #endif
26 +#endif
28 #ifdef DEBUG
29 static void uninit_recvbuff(void);