clisp-cvs Digest, Vol 43, Issue 1

View: New views
1 Messages — Rating Filter:   Alert me  

clisp-cvs Digest, Vol 43, Issue 1

by clisp-cvs-request :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Send clisp-cvs mailing list submissions to
        clisp-cvs@...

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/clisp-cvs
or, via email, send a message with subject or body 'help' to
        clisp-cvs-request@...

You can reach the person managing the list at
        clisp-cvs-owner@...

When replying, please edit your Subject line so it is more specific
than "Re: Contents of clisp-cvs digest..."


CLISP CVS commits for today

Today's Topics:

   1. clisp/src ChangeLog,1.7184,1.7185 package.d,1.134,1.135
      (Vladimir Tzankov)
   2. clisp/src ChangeLog,1.7185,1.7186 makemake.in,1.889,1.890
      (Sam Steingold)


----------------------------------------------------------------------

Message: 1
Date: Sat, 31 Oct 2009 17:37:34 +0000
From: Vladimir Tzankov <vtz@...>
Subject: clisp/src ChangeLog,1.7184,1.7185 package.d,1.134,1.135
To: clisp-cvs@...
Message-ID: <E1N4HtP-0005Zl-00@...>

Update of /cvsroot/clisp/clisp/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21251/src

Modified Files:
        ChangeLog package.d
Log Message:
[MULTITHREAD]: acquire package mutex lock before calling use_package


Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7184
retrieving revision 1.7185
diff -u -d -r1.7184 -r1.7185
--- ChangeLog 30 Oct 2009 13:06:10 -0000 1.7184
+++ ChangeLog 31 Oct 2009 17:37:32 -0000 1.7185
@@ -1,3 +1,9 @@
+2009-10-31  Vladimir Tzankov  <vtzankov@...>
+
+ [MULTITHREAD]: acquire package mutex lock before calling use_package
+ * package.d (unuse_package): package mutex should be locked by caller
+ (UNUSE-PACKAGE, USE-PACKAGE, %IN-PACKAGE): lock the package
+
 2009-10-30  Vladimir Tzankov  <vtzankov@...>
 
  * spvw_garcol.d (gc_sweep1_varobject_page): fix the build when

Index: package.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/package.d,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- package.d 28 Oct 2009 15:38:01 -0000 1.134
+++ package.d 31 Oct 2009 17:37:32 -0000 1.135
@@ -1815,27 +1815,24 @@
  Removes all packages from packlist from the use-list of pack
  and pack from the used-by-lists of all packages from packlist.
  can trigger GC
-*/
+ MT: pack mutex is locked by caller */
 local maygc void unuse_package (object packlist, object pack) {
   pushSTACK(pack);
   pushSTACK(packlist);
+  pushSTACK(NIL);
+  var gcv_object_t *pack_ = &STACK_2;
+  var gcv_object_t *qpack_ = &STACK_0;
   set_break_sem_3();
   /* traverse packlist: */
-  var gcv_object_t *pack_ = &STACK_1;
-  WITH_LISP_MUTEX_LOCK(1,false,&ThePackage(*pack_)->pack_mutex,{
-    pushSTACK(NIL);
-    var gcv_object_t *qpack_ = &STACK_0;
-    while (mconsp(STACK_1)) {
-      STACK_0 = Car(STACK_1);
-      WITH_LISP_MUTEX_LOCK(0,false,&ThePackage(*qpack_)->pack_mutex,{
-        unuse_1package(*pack_,*qpack_);
-      });
-      STACK_1 = Cdr(STACK_1);
-    }
-    skipSTACK(1);
-  });
+  while (mconsp(STACK_1)) {
+    STACK_0 = Car(STACK_1);
+    WITH_LISP_MUTEX_LOCK(0,false,&ThePackage(*qpack_)->pack_mutex,{
+      unuse_1package(*pack_,*qpack_);
+    });
+    STACK_1 = Cdr(STACK_1);
+  }
   clr_break_sem_3();
-  skipSTACK(2);
+  skipSTACK(3);
 }
 
 /* UP: returns the current package
@@ -2455,23 +2452,27 @@
 /* (USE-PACKAGE packs-to-use [package]), CLTL p. 187 */
 LISPFUN(use_package,seclass_default,1,1,norest,nokey,0,NIL) {
   prepare_use_package();
+  var gcv_object_t *pack_ = &STACK_0;
+  var gcv_object_t *packlist_ = &STACK_1;
   WITH_OS_MUTEX_LOCK(2, &all_packages_lock, {
-    var object pack = popSTACK();
-    var object packlist = popSTACK();
-    use_package(packlist,pack);
+    WITH_LISP_MUTEX_LOCK(0,false,&ThePackage(*pack_)->pack_mutex,{
+      use_package(*packlist_,*pack_);
+    });
   });
-  VALUES1(T);
+  skipSTACK(2); VALUES1(T);
 }
 
 /* (UNUSE-PACKAGE packs-to-use [package]), CLTL p. 187 */
 LISPFUN(unuse_package,seclass_default,1,1,norest,nokey,0,NIL) {
   prepare_use_package();
+  var gcv_object_t *pack_ = &STACK_0;
+  var gcv_object_t *packlist_ = &STACK_1;
   WITH_OS_MUTEX_LOCK(2, &all_packages_lock, {
-    var object pack = popSTACK();
-    var object packlist = popSTACK();
-    unuse_package(packlist,pack);
+    WITH_LISP_MUTEX_LOCK(0,false,&ThePackage(*pack_)->pack_mutex,{
+      unuse_package(*packlist_,*pack_);
+    });
   });
-  VALUES1(T);
+  skipSTACK(2); VALUES1(T);
 }
 
 /* UP: Corrects a package(nick)name.
@@ -2587,65 +2588,61 @@
         (kw(nicknames),kw(use),kw(case_sensitive),kw(case_inverted)) ) {
   /* check name and turn into string: */
   STACK_4 = test_stringsymchar_arg(STACK_4,false);
-  /* find package with this name: */
-  var object pack = find_package(STACK_4);
-  if (nullp(pack)) { /* package not found, must create a new one */
-    WITH_OS_MUTEX_LOCK(5,&all_packages_lock, {
+  WITH_OS_MUTEX_LOCK(5,&all_packages_lock, {
+    /* find package with this name: */
+    var object temppack = find_package(STACK_4);
+    if (nullp(temppack)) { /* package not found, must create a new one */
       in_make_package(false);
-    });
-  } else { /* package found */
-    STACK_4 = pack; /* save pack */
-    /* stack-layout: pack, nicknames, uselist, case-sensitive, case-inverted. */
-    if (boundp(STACK_1)) { /* check the case-sensitivity: */
-      var bool value = !nullp(STACK_1);
-      if (!!pack_casesensitivep(pack) != value) {
-        pushSTACK(pack); pushSTACK(pack);
-        STACK_1 = CLSTEXT("One should not change the case sensitiveness of ~S.");
-        funcall(S(warn),2);
-        pack = STACK_4;         /* restore for GC-safety */
-      }
-      if (value) mark_pack_casesensitive(pack);
-      else mark_pack_caseinsensitive(pack);
-    }
-    if (boundp(STACK_0)) { /* check the case-invertedness: */
-      var bool value = !nullp(STACK_0);
-      if (!!pack_caseinvertedp(pack) != value) {
-        pushSTACK(pack); pushSTACK(pack);
-        STACK_1 = CLSTEXT("One should not change the case inversion of ~S.");
-        funcall(S(warn),2);
-        pack = STACK_4;         /* restore for GC-safety */
-      }
-      if (value) mark_pack_caseinverted(pack);
-      else mark_pack_casepreserved(pack);
-    }
-    /* adjust the nicknames: */
-    if (boundp(STACK_3)) {
-      /* install nicknames with RENAME-PACKAGE: */
-      pushSTACK(pack); /* pack */
-      pushSTACK(ThePackage(pack)->pack_name); /* (package-name pack) */
-      pushSTACK(STACK_(3+2)); /* nicknames */
-      /* (RENAME-PACKAGE pack (package-name pack) nicknames) */
-      funcall(L(rename_package),3);
-    }
-    /* adjust the use-list: */
-    if (boundp(STACK_2)) {
-      /* extend use-list with USE-PACKAGE
-         and shorten with UNUSE-PACKAGE: */
-      STACK_1 = STACK_2; /* use-list as 1. argument for USE-PACKAGE */
-      STACK_0 = STACK_4; /* pack as 2. argument for USE-PACKAGE */
-      prepare_use_package(); /* check arguments STACK_1, STACK_0 */
-      WITH_OS_MUTEX_LOCK(5, &all_packages_lock, {
-        /* stack-layout: pack, nicknames, -, new use-list, pack. */
-        { /* execute USE-PACKAGE (with copied use-list): */
-          var object temp = reverse(STACK_1);
-          use_package(temp,STACK_4);
+    } else { /* package found */
+      STACK_4 = temppack; /* save pack */
+      var gcv_object_t *pack_ = &STACK_4;
+      WITH_LISP_MUTEX_LOCK(5,true,&ThePackage(*pack_)->pack_mutex, {
+        /* stack-layout: pack, nicknames, uselist, case-sensitive, case-inverted. */
+        if (boundp(STACK_1)) { /* check the case-sensitivity: */
+          var bool value = !nullp(STACK_1);
+          if (!!pack_casesensitivep(*pack_) != value) {
+            pushSTACK(*pack_); pushSTACK(*pack_);
+            STACK_1 = CLSTEXT("One should not change the case sensitiveness of ~S.");
+            funcall(S(warn),2);
+          }
+          if (value) mark_pack_casesensitive(*pack_);
+          else mark_pack_caseinsensitive(*pack_);
         }
-        /* All packages, that are still listed in the use-list of pack,
-           but which do not occur in the uselist located in STACK_1,
-           are removed with unuse_1package: */
-        { /* traverse use-list of pack */
-          var gcv_object_t *pack_ = &STACK_4;
-          WITH_LISP_MUTEX_LOCK(2,false,&ThePackage(*pack_)->pack_mutex, {
+        if (boundp(STACK_0)) { /* check the case-invertedness: */
+          var bool value = !nullp(STACK_0);
+          if (!!pack_caseinvertedp(*pack_) != value) {
+            pushSTACK(*pack_); pushSTACK(*pack_);
+            STACK_1 = CLSTEXT("One should not change the case inversion of ~S.");
+            funcall(S(warn),2);
+          }
+          if (value) mark_pack_caseinverted(*pack_);
+          else mark_pack_casepreserved(*pack_);
+        }
+        /* adjust the nicknames: */
+        if (boundp(STACK_3)) {
+          /* install nicknames with RENAME-PACKAGE: */
+          pushSTACK(*pack_); /* pack */
+          pushSTACK(ThePackage(*pack_)->pack_name); /* (package-name pack) */
+          pushSTACK(STACK_(3+2)); /* nicknames */
+          /* (RENAME-PACKAGE pack (package-name pack) nicknames) */
+          funcall(L(rename_package),3);
+        }
+        /* adjust the use-list: */
+        if (boundp(STACK_2)) {
+          /* extend use-list with USE-PACKAGE
+             and shorten with UNUSE-PACKAGE: */
+          STACK_1 = STACK_2; /* use-list as 1. argument for USE-PACKAGE */
+          STACK_0 = STACK_4; /* pack as 2. argument for USE-PACKAGE */
+          prepare_use_package(); /* check arguments STACK_1, STACK_0 */
+          /* stack-layout: pack, nicknames, -, new use-list, pack. */
+          { /* execute USE-PACKAGE (with copied use-list): */
+            var object temp = reverse(STACK_1);
+            use_package(temp,STACK_4);
+          }
+          /* All packages, that are still listed in the use-list of pack,
+             but which do not occur in the uselist located in STACK_1,
+             are removed with unuse_1package: */
+          { /* traverse use-list of pack */
             pushSTACK(NIL);
             var gcv_object_t *qpack_ = &STACK_0;
             STACK_1 = ThePackage(*pack_)->pack_use_list;
@@ -2661,14 +2658,14 @@
               STACK_1 = Cdr(STACK_1);
             }
             skipSTACK(1);
-          });
+          }
         }
+        /* the use-list is adjusted correctly. */
+        skipSTACK(4); /* forget uselist, nicknames etc. */
+        VALUES1(popSTACK());
       });
     }
-    /* the use-list is adjusted correctly. */
-    skipSTACK(4); /* forget uselist, nicknames etc. */
-    VALUES1(popSTACK());
-  }
+  });
 }
 
 local one_sym_function_t delete_package_aux;




------------------------------

Message: 2
Date: Sun, 01 Nov 2009 03:32:33 +0000
From: Sam Steingold <sds@...>
Subject: clisp/src ChangeLog,1.7185,1.7186 makemake.in,1.889,1.890
To: clisp-cvs@...
Message-ID: <E1N4RBB-0002kM-Nj@...>

Update of /cvsroot/clisp/clisp/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10504/src

Modified Files:
        ChangeLog makemake.in
Log Message:
(fsstnd): infer based on TSYSOS instead of HSYSOS
and actively discriminate between linuxes and bsds


Index: makemake.in
===================================================================
RCS file: /cvsroot/clisp/clisp/src/makemake.in,v
retrieving revision 1.889
retrieving revision 1.890
diff -u -d -r1.889 -r1.890
--- makemake.in 19 Oct 2009 16:03:10 -0000 1.889
+++ makemake.in 1 Nov 2009 03:32:30 -0000 1.890
@@ -807,11 +807,28 @@
   LOCALEDIR="$localedir"
 fi
 if [ -z "$fsstnd" ]; then       # default fsstnd depends on the OS
-  case ${HSYSOS} in
+  case ${TSYSOS} in
     cygwin | win32gcc )  fsstnd=redhat; ;; # cygwin == redhat!
+    *bsd ) fsstnd=bsd; ;;
+    linux )
+      if test -r /etc/lsb-release; then
+        . /etc/lsb-release;
+        case "${DISTRIB_ID}" in
+          *buntu | Debian | Slackware ) fsstnd=debian; ;;
+          Fedora | Redhat ) fsstnd=redhat; ;;
+          SuSE ) fsstnd=suse; ;;
+          * )  fsstnd=gnu_ext; ;;
+        esac
+      elif test -r /etc/redhat-release; then
+        fsstnd=redhat
+      else fsstnd=gnu_ext
+      fi ;;
     * )  fsstnd=gnu_ext; ;;
   esac
+  test "${verbose}" = true -o "${verbose}" = yes && \
+    echo "inferred: fsstnd = $fsstnd" >&2
 fi
+
 # An explicitly given --docdir overrides the implied value from fsstnd,
 # and the implied value from fsstnd overrides the default.
 if [ -z "$docdir" ] ; then

Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7185
retrieving revision 1.7186
diff -u -d -r1.7185 -r1.7186
--- ChangeLog 31 Oct 2009 17:37:32 -0000 1.7185
+++ ChangeLog 1 Nov 2009 03:32:30 -0000 1.7186
@@ -1,3 +1,8 @@
+2009-10-31  Sam Steingold  <sds@...>
+
+ * makemake.in (fsstnd): infer based on TSYSOS instead of HSYSOS
+ and actively discriminate between linuxes and bsds
+
 2009-10-31  Vladimir Tzankov  <vtzankov@...>
 
  [MULTITHREAD]: acquire package mutex lock before calling use_package




------------------------------

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

------------------------------

_______________________________________________
clisp-cvs mailing list
clisp-cvs@...
https://lists.sourceforge.net/lists/listinfo/clisp-cvs


End of clisp-cvs Digest, Vol 43, Issue 1
****************************************

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
clisp-devel mailing list
clisp-devel@...
https://lists.sourceforge.net/lists/listinfo/clisp-devel