[Date Prev][Date Next] [Chronological] [Thread] [Top]

sunos4-lwp support broken (ITS#114)



Full_Name: Alexander Zangerl
Version: 1.2.0
OS: sunos 4.1.3u1
URL: 
Submission from: (NULL) (193.154.146.21)


configure detects lwp correctly, but the compile fails with some trivial and
some
ugly errors.

thr_lwp.c:
	wants to include "ldap_log.h", nonexistant. fix: remove line

	references types defined in slurpd.h :-(
	fix: include this one
	
	has a minor typo. fix: guess what.

thr_sleep.c:
	references types defined in lwp/lwp.h and slurpd.h :-(
	fix: include these headers

	does reference free_stack, which does not exist.
	fix: replace with ldap_pvt_thread_free_stack


and now for the uglies:
the "scheduler" thread for sleep does reference stuff that's only present
in slurpd :-(((
so, nothing that wants to link liblthread builds - except slurpd.
fix: baah, i've not really fixed that yet. hack: change the thread
initialization to
define the needed data structure (Global *sglob) and initialize it, and remove
the corr. code from slurpd (ugly as hell, therefore not included in my diffs)

the scheduler thread is not killed when slapd tries to exit.
fix: none yet, one had to modify daemon.c and init.c to store the schedulers
tid somewhere and kill this one when exiting.

lwp has no per thread signals, therefore the code in daemon.c that tries 
to pthread_kill the listener thread does not work.
fix: none yet, me thinks slapd should lwp_destroy the mentioned threads.

i include a diff of the relevant files against my hacked version.

regards,
az



diff -ubr openldap-1.2.0-unpatched/libraries/liblthread/thr_lwp.c
openldap-1.2.0
/libraries/liblthread/thr_lwp.c
--- openldap-1.2.0-unpatched/libraries/liblthread/thr_lwp.c     Fri Jan 29
06:11
:49 1999
+++ openldap-1.2.0/libraries/liblthread/thr_lwp.c       Tue Mar 23 15:55:19
1999
@@ -32,13 +32,16 @@
 
 #include "lber.h"
 #include "ldap.h"
-#include "ldap_log.h"
 
 #include <lwp/lwp.h>
 #include <lwp/stackdep.h>
 
+#include "../../servers/slurpd/globals.h"
+
 #define MAX_STACK      51200
-#define MAX_THREADS    20
+#define MAX_THREADS    50
+
+extern Globals *sglob;
 
 /*
  * Initialize LWP by spinning of a schedular
@@ -178,7 +192,7 @@
 int 
 ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
 {
-       return( cond->lcv_created ? cv_notify( cv->lcv_cv ) : 0 );
+       return( cond->lcv_created ? cv_notify( cond->lcv_cv ) : 0 );
 }
 
 int 

diff -ubr openldap-1.2.0-unpatched/libraries/liblthread/thr_sleep.c
openldap-1.2
.0/libraries/liblthread/thr_sleep.c
--- openldap-1.2.0-unpatched/libraries/liblthread/thr_sleep.c   Fri Jan 29
06:11
:49 1999
+++ openldap-1.2.0/libraries/liblthread/thr_sleep.c     Tue Mar 23 14:21:30
1999
@@ -47,6 +47,8 @@
 }
 
 #else
+#include <lwp/lwp.h>
+#include "../../servers/slurpd/globals.h"
 
 unsigned int
 ldap_pvt_thread_sleep(
@@ -145,7 +147,7 @@
 
        mon_exit( &sglob->tsl_mon );
 
-       free_stack( stackno );
+       ldap_pvt_thread_free_stack( stackno );
 }
 
 #endif /* HAVE_LWP */