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:
@@ -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
|
||||
|
||||
|
@@ -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) \
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user