rev 139 - in trunk: include/prothon modules/Re modules/String src

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-03-26 18:28:35 -0500 (Fri, 26 Mar 2004)
New Revision: 139

Modified:
   trunk/include/prothon/prothon.h
   trunk/include/prothon/prothon_dll.h
   trunk/modules/Re/Re.c
   trunk/modules/String/String.c
   trunk/src/builtins.c
   trunk/src/init.pth
   trunk/src/interp.c
   trunk/src/lock.c
   trunk/src/memory_mgr.c
Log:
fixed write_lock usage in del_lock that caused error
write lock attempt of unmutable obj

Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/include/prothon/prothon.h	2004-03-26 23:28:35 UTC (rev 139)
@@ -840,7 +840,7 @@
 // the bit manually if you need to remove an object from the hierarchy temporarily.
 // WARNING: Leaving this bit set will create a memory leak just like not calling
 // free().
-void del_lock  (isp ist, obj_p obj);		
-void del_unlock(isp ist, obj_p obj);
+void del_lock  (obj_p obj);		
+void del_unlock(obj_p obj);
 
 #endif // PROTHON_H

Modified: trunk/include/prothon/prothon_dll.h
===================================================================
--- trunk/include/prothon/prothon_dll.h	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/include/prothon/prothon_dll.h	2004-03-26 23:28:35 UTC (rev 139)
@@ -109,8 +109,8 @@
 	void		  (*write_lock)(isp ist, obj_p obj);		
 	void		(*write_unlock)(isp ist, obj_p obj);
 
-	void		    (*del_lock)(isp ist, obj_p obj);		
-	void		  (*del_unlock)(isp ist, obj_p obj);	
+	void		    (*del_lock)(obj_p obj);		
+	void		  (*del_unlock)(obj_p obj);	
 
 
 } pr_services_t;

Modified: trunk/modules/Re/Re.c
===================================================================
--- trunk/modules/Re/Re.c	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/modules/Re/Re.c	2004-03-26 23:28:35 UTC (rev 139)
@@ -464,7 +464,7 @@
 		res[size] = 0;
 	}
 	res_obj = new_string_obj(res);
-	del_unlock(ist, match_obj);
+	del_unlock(match_obj);
 	pr_free(res);
 	pr_free(m);
 	return res_obj;

Modified: trunk/modules/String/String.c
===================================================================
--- trunk/modules/String/String.c	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/modules/String/String.c	2004-03-26 23:28:35 UTC (rev 139)
@@ -217,7 +217,7 @@
 	}
 	dest_ptr[tlen] = 0;
 	obj->unmutable = TRUE;
-	del_unlock(ist, str_list);
+	del_unlock(str_list);
 	return obj;
 }
 

Modified: trunk/src/builtins.c
===================================================================
--- trunk/src/builtins.c	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/src/builtins.c	2004-03-26 23:28:35 UTC (rev 139)
@@ -839,7 +839,7 @@
 	float_self  = call_func1(ist, OBJ(FLOAT_PROTO), SYM(__COERCE__), self);  if_exc_return NULL;
 	float_other = call_func1(ist, OBJ(FLOAT_PROTO), SYM(__COERCE__), other); if_exc_return NULL;
 	res = call_func1(ist, float_self, SYM(__DIV__), float_other);
-	del_unlock(ist, float_self);  del_unlock(ist, float_other);  
+	del_unlock(float_self);  del_unlock(float_other);  
 	return res;
 }
 
@@ -901,7 +901,7 @@
 	float_self  = call_func1(ist, OBJ(FLOAT_PROTO), SYM(__COERCE__), self);  if_exc_return NULL;
 	float_other = call_func1(ist, OBJ(FLOAT_PROTO), SYM(__COERCE__), other); if_exc_return NULL;
 	res = call_func1(ist, float_self, SYM(__POW__), float_other);
-	del_unlock(ist, float_self); del_unlock(ist, float_other); 
+	del_unlock(float_self); del_unlock(float_other); 
 	return res;
 }
 

Modified: trunk/src/init.pth
===================================================================
--- trunk/src/init.pth	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/src/init.pth	2004-03-26 23:28:35 UTC (rev 139)
@@ -5,7 +5,6 @@
 
 # these are added to sys.path
 
-c:\prothon\modules\int\debug
 c:\prothon\modules\float\debug
 c:\prothon\modules\string\debug
 c:\prothon\modules\file\debug
@@ -15,5 +14,5 @@
 
 # this is executed before Main as module PthMod1
 
-import Int, Float, String, File, Re, List, Tuple
+import Float, String, File, Re, List, Tuple
 
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/src/interp.c	2004-03-26 23:28:35 UTC (rev 139)
@@ -1113,18 +1113,18 @@
 								(plist ? (obj_p*)plist->items : NULL), dyn_locals);
 		post_call_unlock(self, plist);
 		free_clist(plist);
-		if (!func_sym) del_unlock(ist, self);
+		if (!func_sym) del_unlock(self);
 		return res;
 	} else if (has_proto(ist, func_obj, OBJ(FUNC_PROTO))) {
 		exec_frame_t *frame, *new_frame;
 		obj_p new_locals; 
 		if (!ist) {
 			raise_exception(ist, OBJ(INTERNAL_EXC), "Illegal function call to Prothon function");
-			if (!func_sym) del_unlock(ist, self);
+			if (!func_sym) del_unlock(self);
 			return 0;
 		}
 		if (intrp_exobj) {
-			if (!func_sym) del_unlock(ist, self);
+			if (!func_sym) del_unlock(self);
 			return 0;
 		}
 		frame = ist->frame;
@@ -1136,15 +1136,15 @@
 		load_frame_params( ist, frame, func_obj, parm_cnt, lbl_val_arr);
 		ist->frame = new_frame;
 		if (intrp_exobj) {
-			if (!func_sym) del_unlock(ist, self);
+			if (!func_sym) del_unlock(self);
 			return 0;
 		}
 		if (!func_sym) 
-			del_unlock(ist, self);
+			del_unlock(self);
 		return exec_loop(ist);
 	} else {
 		raise_exception(ist, OBJ(FUNCNOTFOUND_EXC), "Function not found");
-		if (!func_sym) del_unlock(ist, self);
+		if (!func_sym) del_unlock(self);
 		return 0;
 	}
 }

Modified: trunk/src/lock.c
===================================================================
--- trunk/src/lock.c	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/src/lock.c	2004-03-26 23:28:35 UTC (rev 139)
@@ -255,15 +255,15 @@
 }
 
 //********************************* del_lock **********************************
-void del_lock(isp ist, obj_p obj) {
-	write_lock(ist, obj); 
+void del_lock(obj_p obj) {
+	get_wrlock(obj, NO_WAIT);
 	obj->del_locked = TRUE; 
-	write_unlock(ist, obj);
+	free_obj_wrlock(obj);
 }
 
 //********************************* del_unlock ********************************
-void del_unlock(isp ist, obj_p obj) {
-	write_lock(ist, obj);
+void del_unlock(obj_p obj) {
+	get_wrlock(obj, NO_WAIT);
 	obj->del_locked = FALSE;
-	write_unlock(ist, obj);
+	free_obj_wrlock(obj);
 }

Modified: trunk/src/memory_mgr.c
===================================================================
--- trunk/src/memory_mgr.c	2004-03-26 22:31:07 UTC (rev 138)
+++ trunk/src/memory_mgr.c	2004-03-26 23:28:35 UTC (rev 139)
@@ -229,7 +229,7 @@
 						}
 					}
 					if (obj_list != obj && obj_list != mm_obj_list)
-						del_unlock(ist, obj_list);
+						del_unlock(obj_list);
 				}
 			}
 			read_unlock(ist, obj);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.