2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

3661. [bug] Address lock order reversal deadlock with inline zones.

[RT #34856]
This commit is contained in:
Mark Andrews
2013-10-08 11:43:08 +11:00
parent aacd7daaf7
commit 03152360db
9 changed files with 247 additions and 24 deletions

View File

@@ -29,6 +29,7 @@ void
isc_thread_setconcurrency(unsigned int level);
#define isc_thread_self() ((unsigned long)0)
#define isc_thread_yield() ((void)0)
ISC_LANG_ENDDECLS

View File

@@ -41,6 +41,9 @@ isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *);
void
isc_thread_setconcurrency(unsigned int level);
void
isc_thread_yield(void);
/* XXX We could do fancier error handling... */
#define isc_thread_join(t, rp) \

View File

@@ -21,6 +21,10 @@
#include <config.h>
#if defined(HAVE_SCHED_H)
#include <sched.h>
#endif
#include <isc/thread.h>
#include <isc/util.h>
@@ -74,3 +78,14 @@ isc_thread_setconcurrency(unsigned int level) {
UNUSED(level);
#endif
}
void
isc_thread_yield(void) {
#if defined(HAVE_SCHED_YIELD)
sched_yield();
#elif defined( HAVE_PTHREAD_YIELD)
pthread_yield();
#elif defined( HAVE_PTHREAD_YIELD_NP)
pthread_yield_np();
#endif
}

View File

@@ -95,6 +95,8 @@ isc_thread_key_getspecific(isc_thread_key_t);
int
isc_thread_key_setspecific(isc_thread_key_t key, void *value);
#define isc_thread_yield() Sleep(0)
ISC_LANG_ENDDECLS
#endif /* ISC_THREAD_H */