pkgsrc/net/ettercap/patches/patch-ad
jmmv 197d6bf6bb Fix crash in -current: a thread was trying to wait for a condition using an
unlocked mutex (thus triggering a libpthread assertion).  I'm not sure if
this patch is completely right, but the program seems to work fine.
Bump PKGREVISION to 2.
2003-06-07 10:42:26 +00:00

37 lines
954 B
Text

$NetBSD: patch-ad,v 1.1 2003/06/07 10:42:27 jmmv Exp $
--- src/ec_illithid.c.orig 2002-09-06 10:57:31.000000000 +0200
+++ src/ec_illithid.c
@@ -87,8 +87,8 @@ int illithid_gwip;
int illithid_buffer = -1;
pthread_t decoder_pid;
-pthread_mutex_t decoder_mtx = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t decoder_cond = PTHREAD_COND_INITIALIZER;
+pthread_mutex_t decoder_mtx;
+pthread_cond_t decoder_cond;
// protos...
@@ -117,6 +117,11 @@ void * Illithid_Decoder(void *dummy)
DEBUG_MSG("Illithid_Decoder -- running");
+ pthread_mutex_init(&decoder_mtx, NULL);
+ pthread_cond_init(&decoder_cond, NULL);
+
+ pthread_mutex_lock(&decoder_mtx);
+
LOOP {
pthread_testcancel();
@@ -1110,6 +1115,9 @@ void Illithid_Reset_Conn(void *dummy)
hash_table[j] = 0;
}
+ pthread_mutex_lock(&decoder_mtx);
+ pthread_mutex_unlock(&decoder_mtx);
+
ECThread_destroy(decoder_pid);
Buffer_Flush(illithid_buffer);