Jennie,
in fact, only xprc_admin and xrpc_trusted are currently(?) used/required as
global C variable in xrpc_server.c , all other BATs are indeed share as
(global) MIL variables and/or via the BAT names.
Hence, the attached patch would IMHO clean-up the code even more.
(I.e., reduce use of / need for global variables as much as possible.)
Stefan
On Thu, Jul 17, 2008 at 10:51:38AM +0000, Ying Zhang wrote:
> Update of /cvsroot/monetdb/pathfinder/runtime
> In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24940
>
> Modified Files:
> xrpc_common.mx xrpc_server.mx
> Log Message:
> Try to fix bug
>
> [ 2020269 ] PF/runtime fails to link on Darwin (MacOS X)
>
> remove declaratin of BATs xrpc_* from xrpc_common.mx
> xrpc_trusted and xrpc_admin are not shared BATs (only used by
> xrpc_server), the others are shared via MIL, so should no be (re)defined
> in xrpc_common.mx
>
>
>
> U xrpc_common.mx
> Index: xrpc_common.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_common.mx,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -d -r1.4 -r1.5
> --- xrpc_common.mx 15 Jul 2008 14:14:21 -0000 1.4
> +++ xrpc_common.mx 17 Jul 2008 10:51:33 -0000 1.5
> @@ -182,14 +182,6 @@
> XRPCreq_t *xrpc_parse_message(char *err, int errlen, BAT *shredBAT,
> BAT *participants);
>
> -BAT *xrpc_qids;
> -BAT *xrpc_timeouts;
> -BAT *xrpc_statuses;
> -BAT *xrpc_locks;
> -BAT *xrpc_wsbats;
> -BAT *xrpc_trusted;
> -BAT *xrpc_admin;
> -
> #endif /* XRPC_COMMON_H */
>
> @c
>
> U xrpc_server.mx
> Index: xrpc_server.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
> retrieving revision 1.77
> retrieving revision 1.78
> diff -u -d -r1.77 -r1.78
> --- xrpc_server.mx 15 Jul 2008 14:14:23 -0000 1.77
> +++ xrpc_server.mx 17 Jul 2008 10:51:33 -0000 1.78
> @@ -194,6 +194,12 @@
> static MT_Sema xrpc_commit_sema;
> static xrpc_commit_t *xrpc_commit_active = NULL;
>
> +/* shared BATs */
> +BAT *xrpc_qids = NULL, *xrpc_statuses = NULL, *xrpc_timeouts = NULL;
> +BAT *xrpc_locks = NULL, *xrpc_wsbats = NULL;
> +/* only used by xrpc_server */
> +BAT *xrpc_trusted = NULL, *xrpc_admin = NULL, *xrpc_user = NULL;
> +
> int CMDmy_hostname(char **res)
> {
> int ret = 0, len = HOST_NAME_MAX > 255 ? HOST_NAME_MAX : 255;
> @@ -871,9 +877,6 @@
> BATseqbase([EMAIL PROTECTED], 1);
> BBPrename([EMAIL PROTECTED]>batCacheid, "[EMAIL PROTECTED]");
> @c
> -BAT *xrpc_qids = NULL, *xrpc_statuses = NULL, *xrpc_timeouts = NULL,
> *xrpc_locks = NULL, *xrpc_wsbats = NULL;
> -BAT *xrpc_trusted = NULL, *xrpc_admin = NULL, *xrpc_user = NULL;
> -
>
> bat* xrpc_prelude(void) {
> @:xrpc_bat(qids,str)@
> @@ -881,6 +884,7 @@
> @:xrpc_bat(timeouts,lng)@
> @:xrpc_bat(locks,lock)@
> @:xrpc_bat(wsbats,bat)@
> +
> @:xrpc_bat(trusted,str)@
> @:xrpc_bat(admin,str)@
> @:xrpc_bat(user,str)@
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Monetdb-pf-checkins mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins
>
>
--
| Dr. Stefan Manegold | mailto:[EMAIL PROTECTED] |
| CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ |
| 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 |
| The Netherlands | Fax : +31 (20) 592-4312 |
Index: xrpc_server.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
retrieving revision 1.78
diff -u -r1.78 xrpc_server.mx
--- xrpc_server.mx 17 Jul 2008 10:51:33 -0000 1.78
+++ xrpc_server.mx 17 Jul 2008 11:05:53 -0000
@@ -194,11 +194,7 @@
static MT_Sema xrpc_commit_sema;
static xrpc_commit_t *xrpc_commit_active = NULL;
-/* shared BATs */
-BAT *xrpc_qids = NULL, *xrpc_statuses = NULL, *xrpc_timeouts = NULL;
-BAT *xrpc_locks = NULL, *xrpc_wsbats = NULL;
-/* only used by xrpc_server */
-BAT *xrpc_trusted = NULL, *xrpc_admin = NULL, *xrpc_user = NULL;
+BAT *xrpc_trusted = NULL, *xrpc_admin = NULL;
int CMDmy_hostname(char **res)
{
@@ -872,13 +868,14 @@
@= xrpc_bat
- [EMAIL PROTECTED] = BATnew(TYPE_void,ATOMindex("@2"),1024);
- assert([EMAIL PROTECTED]);
- BATseqbase([EMAIL PROTECTED], 1);
- BBPrename([EMAIL PROTECTED]>batCacheid, "[EMAIL PROTECTED]");
+ xrpc_bat = BATnew(TYPE_void,ATOMindex("@2"),1024);
+ assert(xrpc_bat);
+ BATseqbase(xrpc_bat, 1);
+ BBPrename(xrpc_bat->batCacheid, "[EMAIL PROTECTED]");
@c
bat* xrpc_prelude(void) {
+ BAT *xrpc_bat = NULL;
@:xrpc_bat(qids,str)@
@:xrpc_bat(statuses,str)@
@:xrpc_bat(timeouts,lng)@
@@ -886,7 +883,9 @@
@:xrpc_bat(wsbats,bat)@
@:xrpc_bat(trusted,str)@
+ xrpc_trusted = xrpc_bat;
@:xrpc_bat(admin,str)@
+ xrpc_admin = xrpc_bat;
@:xrpc_bat(user,str)@
CMDmy_hostname(&xrpc_hostname);
MT_init_sema(xrpc_commit_sema,0, "XRPC_COMMIT_SEMA");
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers