Fixed posixthreads bug.
authorMilind Bhandarkar <milind@cs.uiuc.edu>
Fri, 1 Aug 1997 21:33:00 +0000 (21:33 +0000)
committerMilind Bhandarkar <milind@cs.uiuc.edu>
Fri, 1 Aug 1997 21:33:00 +0000 (21:33 +0000)
src/arch/net/machine.c
src/arch/uth-linux/conv-mach.csh [new file with mode: 0755]
src/arch/uth-linux/conv-mach.h [new file with mode: 0644]
src/conv-core/cpthreads.c
src/conv-core/threads.c

index 194eb6014cbeb67b79f767bd046fdb7745e5ce71..6a68da32a14b4d04152c3ddc1494201b7e7a64f1 100644 (file)
@@ -964,7 +964,7 @@ char **argv;
  *
  *****************************************************************************/
 
-#define LOGGING 1
+#define LOGGING 0
 
 #if LOGGING
 
diff --git a/src/arch/uth-linux/conv-mach.csh b/src/arch/uth-linux/conv-mach.csh
new file mode 100755 (executable)
index 0000000..77f1d6f
--- /dev/null
@@ -0,0 +1,44 @@
+############################################################################
+# RCS INFORMATION:
+#
+#      $RCSfile$
+#      $Author$        $Locker$                $State$
+#      $Revision$      $Date$
+#
+############################################################################
+# DESCRIPTION:
+#
+############################################################################
+# REVISION HISTORY:
+#
+#
+############################################################################
+
+set CMK_CPP_CHARM='/usr/lib/cpp'
+set CMK_CPP_C='gcc -E'
+set CMK_CXXPP='g++ -x c++ -E'
+set CMK_CC='gcc'
+set CMK_CC_RELIABLE='gcc'
+set CMK_CC_FASTEST='gcc'
+set CMK_CXX='g++'
+set CMK_CF77=''
+set CMK_C_DEBUG='-g'
+set CMK_C_OPTIMIZE='-O'
+set CMK_CXX_DEBUG='-g'
+set CMK_CXX_OPTIMIZE='-O'
+set CMK_LD='gcc'
+set CMK_LDXX='g++'
+set CMK_LD77=''
+set CMK_M4='m4'
+set CMK_SUF='o'
+set CMK_AR='ar q'
+set CMK_RANLIB='ranlib'
+set CMK_LIBS='-lqt'
+set CMK_SEQ_LIBS=''
+set CMK_SEQ_CC='gcc'
+set CMK_SEQ_LD='gcc'
+set CMK_SEQ_CXX='g++'
+set CMK_SEQ_LDXX='g++'
+set CMK_CPP_SUFFIX="ii"
+set CMK_XLATPP='charmxlat++ '
+set CMK_QT='generic'
diff --git a/src/arch/uth-linux/conv-mach.h b/src/arch/uth-linux/conv-mach.h
new file mode 100644 (file)
index 0000000..9d4e5fc
--- /dev/null
@@ -0,0 +1,168 @@
+/***************************************************************************
+ * RCS INFORMATION:
+ *
+ *   $RCSfile$
+ *   $Author$       $Locker$        $State$
+ *   $Revision$     $Date$
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.1  1997-08-01 21:33:08  milind
+ * Fixed posixthreads bug.
+ *
+ * Revision 1.30  1997/07/28 19:01:45  jyelon
+ * *** empty log message ***
+ *
+ * Revision 1.29  1997/07/26 16:42:38  jyelon
+ * *** empty log message ***
+ *
+ * Revision 1.28  1997/05/05 13:57:20  jyelon
+ * Updated for quickthreads
+ *
+ * Revision 1.27  1997/04/01 08:10:50  jyelon
+ * Added CMK_GETPAGESIZE_AVAILABLE
+ *
+ * Revision 1.26  1997/03/25 23:09:33  milind
+ * Got threads to work on 64-bit irix. Had to add JB_TWEAKING_ORIGIN flag to
+ * all the conv-mach.h files. Also, _PAGESZ was undefined on irix. Added
+ * code to memory.c to make it a static variable.
+ *
+ * Revision 1.25  1997/03/19 04:58:29  jyelon
+ * Removed the CMK_DEFAULT_MAIN_USES_SIMULATOR_CODE flag.
+ *
+ * Revision 1.24  1997/02/13 09:32:03  jyelon
+ * Updated for new main/ConverseInit structure.
+ *
+ * Revision 1.23  1997/02/08 14:10:35  jyelon
+ * Correcting bugs in network version.
+ *
+ * Revision 1.22  1997/02/06 20:21:16  jyelon
+ * Added BLANK_SPACE bla bla.
+ *
+ * Revision 1.21  1997/01/17 15:50:46  jyelon
+ * Minor adjustments to deal with recent changes to Common code.
+ *
+ * Revision 1.20  1996/11/23 02:25:47  milind
+ * Fixed several subtle bugs in the converse runtime for convex
+ * exemplar.
+ *
+ * Revision 1.19  1996/11/08 22:23:13  brunner
+ * Put _main in for HP-UX CC compilation.  It is ignored according to the
+ * CMK_USE_HP_MAIN_FIX flag.
+ *
+ * Revision 1.18  1996/10/24 19:40:35  milind
+ * Added CMK_IS_HETERO to all the net-all versions.
+ *
+ * Revision 1.17  1996/08/08 20:16:53  jyelon
+ * *** empty log message ***
+ *
+ * Revision 1.16  1996/08/05 15:28:49  jyelon
+ * *** empty log message ***
+ *
+ * Revision 1.15  1996/07/24  22:51:34  jyelon
+ * Changed to 'times' not 'getrusage'
+ *
+ * Revision 1.14  1996/07/16  17:23:37  jyelon
+ * Renamed a flag.
+ *
+ * Revision 1.13  1996/07/16 05:20:41  milind
+ * Added CMK_VECTOR_SEND
+ *
+ * Revision 1.12  1996/07/15  20:58:27  jyelon
+ * Flags now use #if, not #ifdef.  Also cleaned up a lot.
+ *
+ *
+ **************************************************************************/
+
+#ifndef _CONV_MACH_H
+#define _CONV_MACH_H
+
+#define CMK_ASYNC_NOT_NEEDED                               1
+#define CMK_ASYNC_USE_FIOASYNC_AND_FIOSETOWN               0
+#define CMK_ASYNC_USE_FIOASYNC_AND_SIOCSPGRP               0
+#define CMK_ASYNC_USE_FIOSSAIOSTAT_AND_FIOSSAIOOWN         0
+#define CMK_ASYNC_USE_F_SETFL_AND_F_SETOWN                 0
+
+#define CMK_CMIDELIVERS_USE_COMMON_CODE                    0
+#define CMK_CMIDELIVERS_USE_SPECIAL_CODE                   1
+
+#define CMK_CMIPRINTF_IS_A_BUILTIN                         0
+#define CMK_CMIPRINTF_IS_JUST_PRINTF                       1
+
+#define CMK_COMMHANDLE_IS_AN_INTEGER                       0
+#define CMK_COMMHANDLE_IS_A_POINTER                        1
+
+#define CMK_CSDEXITSCHEDULER_IS_A_FUNCTION                 0
+#define CMK_CSDEXITSCHEDULER_SET_CSDSTOPFLAG               1
+
+#define CMK_FIX_HP_CONNECT_BUG                             0
+
+#define CMK_GETPAGESIZE_AVAILABLE                          0
+
+#define CMK_IS_HETERO                                      0
+
+#define CMK_MACHINE_NAME                                   "uth-linux"
+
+#define CMK_MALLOC_USE_GNU_MALLOC                          0
+#define CMK_MALLOC_USE_OS_BUILTIN                          1
+
+#define CMK_MSG_HEADER_SIZE_BYTES                          4
+#define CMK_MSG_HEADER_BLANK_SPACE                         0
+
+#define CMK_PREPROCESSOR_CANNOT_DO_CONCATENATION           0
+#define CMK_PREPROCESSOR_USES_ANSI_STANDARD_CONCATENATION  1
+
+#define CMK_PROTOTYPES_FAIL                                0
+#define CMK_PROTOTYPES_WORK                                1
+
+#define CMK_RSH_IS_A_COMMAND                               1
+#define CMK_RSH_NOT_NEEDED                                 0
+#define CMK_RSH_USE_REMSH                                  0
+
+#define CMK_SHARED_VARS_EXEMPLAR                           0
+#define CMK_SHARED_VARS_UNAVAILABLE                        0
+#define CMK_SHARED_VARS_SUN_THREADS                        0
+#define CMK_SHARED_VARS_UNIPROCESSOR                       1
+
+#define CMK_SIGHOLD_IS_A_BUILTIN                           0
+#define CMK_SIGHOLD_NOT_NEEDED                             0
+#define CMK_SIGHOLD_USE_SIGMASK                            1
+
+#define CMK_SIGNAL_NOT_NEEDED                              0
+#define CMK_SIGNAL_USE_SIGACTION                           1
+#define CMK_SIGNAL_USE_SIGACTION_WITH_RESTART              0
+
+#define CMK_SIZE_T                                         unsigned int
+
+#define CMK_STATIC_PROTO_FAILS                             0
+#define CMK_STATIC_PROTO_WORKS                             1
+
+#define CMK_STRERROR_IS_A_BUILTIN                          0
+#define CMK_STRERROR_USE_SYS_ERRLIST                       1
+
+#define CMK_STRINGS_USE_OWN_DECLARATIONS                   1
+#define CMK_STRINGS_USE_STRINGS_H                          0
+#define CMK_STRINGS_USE_STRING_H                           0
+
+#define CMK_THREADS_REQUIRE_NO_CPV                         1
+
+#define CMK_TIMER_USE_GETRUSAGE                            0
+#define CMK_TIMER_USE_SPECIAL                              0
+#define CMK_TIMER_USE_TIMES                                1
+
+#define CMK_VECTOR_SEND_USES_COMMON_CODE                    1
+#define CMK_VECTOR_SEND_USES_SPECIAL_CODE                   0
+
+#define CMK_WAIT_NOT_NEEDED                                0
+#define CMK_WAIT_USES_SYS_WAIT_H                           1
+#define CMK_WAIT_USES_WAITFLAGS_H                          0
+
+#define CMK_WHEN_PROCESSOR_IDLE_BUSYWAIT                   1
+#define CMK_WHEN_PROCESSOR_IDLE_USLEEP                     0
+
+#define CMK_USE_HP_MAIN_FIX                                0
+#define CMK_DONT_USE_HP_MAIN_FIX                           1
+
+#endif
+
index a841f653529e7cdfa583b1dda4ae9ec697cc6047..7dfe3be5e0bb2a58692d5bfb3c321afea950430c 100644 (file)
@@ -322,8 +322,8 @@ void Cpthread_exit(void *status)
   }
   /* handle the join-operation */
   if (pt->detached) {
-    free(pt);
     pt->magic = 0;
+    free(pt);
   } else {
     pt->joinstatus = status;
     pt->thread = 0;
index 49fdc16032a38bfad043cb380b922829712525ef..b0a974be904de7533313e342e6637073b350f899 100644 (file)
@@ -239,9 +239,8 @@ static void CthOnly(void *arg, void *vt, qt_userf_t fn)
 {
   CthThread t = (CthThread)vt; CthThread next;
   fn(arg);
-  if (t->choosefn==0) CthNoStrategy();
-  next = (t->choosefn)();
-  QT_ABORT((qt_helper_t*)CthAbortHelp, t, 0, next->stackp);
+  CthCpvAccess(CthExiting) = 1;
+  CthSuspend();
 }
 
 CthThread CthCreate(fn, arg, size)